Remove usage of specialization from newtype_index!

This commit is contained in:
bjorn3 2023-12-31 18:35:49 +00:00
parent 2975a21b5d
commit f23c1fdaeb
4 changed files with 3 additions and 13 deletions

View File

@ -1,10 +1,7 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(all(feature = "nightly", test), feature(stmt_expr_attributes))] #![cfg_attr(all(feature = "nightly", test), feature(stmt_expr_attributes))]
#![cfg_attr(
feature = "nightly",
feature(extend_one, min_specialization, new_uninit, step_trait, test)
)]
#![cfg_attr(feature = "nightly", allow(internal_features))] #![cfg_attr(feature = "nightly", allow(internal_features))]
#![cfg_attr(feature = "nightly", feature(extend_one, new_uninit, step_trait, test))]
// tidy-alphabetical-end // tidy-alphabetical-end
pub mod bit_set; pub mod bit_set;

View File

@ -34,10 +34,7 @@
/// optimizations. The default max value is 0xFFFF_FF00. /// optimizations. The default max value is 0xFFFF_FF00.
/// - `#[gate_rustc_only]`: makes parts of the generated code nightly-only. /// - `#[gate_rustc_only]`: makes parts of the generated code nightly-only.
#[proc_macro] #[proc_macro]
#[cfg_attr( #[cfg_attr(feature = "nightly", allow_internal_unstable(step_trait, rustc_attrs, trusted_step))]
feature = "nightly",
allow_internal_unstable(step_trait, rustc_attrs, trusted_step, min_specialization)
)]
pub fn newtype_index(input: TokenStream) -> TokenStream { pub fn newtype_index(input: TokenStream) -> TokenStream {
newtype::newtype(input) newtype::newtype(input)
} }

View File

@ -139,10 +139,6 @@ fn backward_checked(start: Self, u: usize) -> Option<Self> {
Self::index(start).checked_sub(u).map(Self::from_usize) Self::index(start).checked_sub(u).map(Self::from_usize)
} }
} }
// Safety: The implementation of `Step` upholds all invariants.
#gate_rustc_only
unsafe impl ::std::iter::TrustedStep for #name {}
} }
} else { } else {
quote! {} quote! {}

View File

@ -2,7 +2,7 @@
#![allow(rustc::usage_of_ty_tykind)] #![allow(rustc::usage_of_ty_tykind)]
#![cfg_attr( #![cfg_attr(
feature = "nightly", feature = "nightly",
feature(associated_type_defaults, min_specialization, never_type, rustc_attrs, negative_impls) feature(associated_type_defaults, never_type, rustc_attrs, negative_impls)
)] )]
#![cfg_attr(feature = "nightly", allow(internal_features))] #![cfg_attr(feature = "nightly", allow(internal_features))]
// tidy-alphabetical-end // tidy-alphabetical-end