diff --git a/compiler/rustc_passes/src/lib_features.rs b/compiler/rustc_passes/src/lib_features.rs index 00445690f8f02..c414d7c031c04 100644 --- a/compiler/rustc_passes/src/lib_features.rs +++ b/compiler/rustc_passes/src/lib_features.rs @@ -29,10 +29,11 @@ impl<'tcx> LibFeatureCollector<'tcx> { } fn extract(&self, attr: &Attribute) -> Option<(Symbol, Option, Span)> { - let stab_attrs = [sym::stable, sym::unstable, sym::rustc_const_unstable]; + let stab_attrs = + [sym::stable, sym::unstable, sym::rustc_const_stable, sym::rustc_const_unstable]; - // Find a stability attribute (i.e., `#[stable (..)]`, `#[unstable (..)]`, - // `#[rustc_const_unstable (..)]`). + // Find a stability attribute: one of #[stable(…)], #[unstable(…)], + // #[rustc_const_stable(…)], or #[rustc_const_unstable(…)]. if let Some(stab_attr) = stab_attrs.iter().find(|stab_attr| attr.has_name(**stab_attr)) { let meta_kind = attr.meta_kind(); if let Some(MetaItemKind::List(ref metas)) = meta_kind { @@ -52,7 +53,9 @@ impl<'tcx> LibFeatureCollector<'tcx> { // This additional check for stability is to make sure we // don't emit additional, irrelevant errors for malformed // attributes. - if *stab_attr != sym::stable || since.is_some() { + let is_unstable = + matches!(*stab_attr, sym::unstable | sym::rustc_const_unstable); + if since.is_some() || is_unstable { return Some((feature, since, attr.span)); } } diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs index 0639d6eed62a5..db6898c1308a2 100644 --- a/library/core/src/alloc/layout.rs +++ b/library/core/src/alloc/layout.rs @@ -56,7 +56,7 @@ impl Layout { /// must not overflow (i.e., the rounded value must be less than /// or equal to `usize::MAX`). #[stable(feature = "alloc_layout", since = "1.28.0")] - #[rustc_const_stable(feature = "const_alloc_layout", since = "1.50.0")] + #[rustc_const_stable(feature = "const_alloc_layout_size_align", since = "1.50.0")] #[inline] pub const fn from_size_align(size: usize, align: usize) -> Result { if !align.is_power_of_two() { @@ -93,7 +93,7 @@ impl Layout { /// This function is unsafe as it does not verify the preconditions from /// [`Layout::from_size_align`]. #[stable(feature = "alloc_layout", since = "1.28.0")] - #[rustc_const_stable(feature = "alloc_layout", since = "1.36.0")] + #[rustc_const_stable(feature = "const_alloc_layout_unchecked", since = "1.36.0")] #[must_use] #[inline] pub const unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Self { @@ -103,7 +103,7 @@ impl Layout { /// The minimum size in bytes for a memory block of this layout. #[stable(feature = "alloc_layout", since = "1.28.0")] - #[rustc_const_stable(feature = "const_alloc_layout", since = "1.50.0")] + #[rustc_const_stable(feature = "const_alloc_layout_size_align", since = "1.50.0")] #[must_use] #[inline] pub const fn size(&self) -> usize { @@ -112,7 +112,7 @@ impl Layout { /// The minimum byte alignment for a memory block of this layout. #[stable(feature = "alloc_layout", since = "1.28.0")] - #[rustc_const_stable(feature = "const_alloc_layout", since = "1.50.0")] + #[rustc_const_stable(feature = "const_alloc_layout_size_align", since = "1.50.0")] #[must_use = "this returns the minimum alignment, \ without modifying the layout"] #[inline] diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index 7deb3358c95d5..3195205b1b677 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -1092,7 +1092,7 @@ impl char { /// ``` #[must_use] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] - #[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.32.0")] + #[rustc_const_stable(feature = "const_char_is_ascii", since = "1.32.0")] #[inline] pub const fn is_ascii(&self) -> bool { *self as u32 <= 0x7F diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index 8ad4317c145ac..474a632773fb8 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -1638,7 +1638,7 @@ extern "rust-intrinsic" { /// let num_trailing = unsafe { cttz_nonzero(x) }; /// assert_eq!(num_trailing, 3); /// ``` - #[rustc_const_stable(feature = "const_cttz", since = "1.53.0")] + #[rustc_const_stable(feature = "const_cttz_nonzero", since = "1.53.0")] pub fn cttz_nonzero(x: T) -> T; /// Reverses the bytes in an integer type `T`. @@ -1718,7 +1718,7 @@ extern "rust-intrinsic" { /// Safe wrappers for this intrinsic are available on the integer /// primitives via the `checked_div` method. For example, /// [`u32::checked_div`] - #[rustc_const_stable(feature = "const_int_unchecked_arith", since = "1.52.0")] + #[rustc_const_stable(feature = "const_int_unchecked_div", since = "1.52.0")] pub fn unchecked_div(x: T, y: T) -> T; /// Returns the remainder of an unchecked division, resulting in /// undefined behavior when `y == 0` or `x == T::MIN && y == -1` @@ -1726,7 +1726,7 @@ extern "rust-intrinsic" { /// Safe wrappers for this intrinsic are available on the integer /// primitives via the `checked_rem` method. For example, /// [`u32::checked_rem`] - #[rustc_const_stable(feature = "const_int_unchecked_arith", since = "1.52.0")] + #[rustc_const_stable(feature = "const_int_unchecked_rem", since = "1.52.0")] pub fn unchecked_rem(x: T, y: T) -> T; /// Performs an unchecked left shift, resulting in undefined behavior when diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 445a7ba6e2d66..7dfcc36ce9391 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -97,7 +97,6 @@ // Library features: #![feature(const_align_offset)] #![feature(const_align_of_val)] -#![feature(const_alloc_layout)] #![feature(const_arguments_as_str)] #![feature(const_array_into_iter_constructors)] #![feature(const_bigint_helper_methods)] diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index 9db5a9a288940..58d682fc4c8d4 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -622,7 +622,7 @@ impl MaybeUninit { /// // `x` had not been initialized yet, so this last line caused undefined behavior. ⚠️ /// ``` #[stable(feature = "maybe_uninit", since = "1.36.0")] - #[rustc_const_stable(feature = "const_maybe_uninit_assume_init", since = "1.59.0")] + #[rustc_const_stable(feature = "const_maybe_uninit_assume_init_by_value", since = "1.59.0")] #[inline(always)] #[rustc_diagnostic_item = "assume_init"] #[track_caller] @@ -788,7 +788,7 @@ impl MaybeUninit { /// } /// ``` #[stable(feature = "maybe_uninit_ref", since = "1.55.0")] - #[rustc_const_stable(feature = "const_maybe_uninit_assume_init", since = "1.59.0")] + #[rustc_const_stable(feature = "const_maybe_uninit_assume_init_ref", since = "1.59.0")] #[inline(always)] pub const unsafe fn assume_init_ref(&self) -> &T { // SAFETY: the caller must guarantee that `self` is initialized. diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 8a99bed6a96ab..005f8749e01e6 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -299,7 +299,7 @@ pub fn forget_unsized(t: T) { #[must_use] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] -#[rustc_const_stable(feature = "const_size_of", since = "1.24.0")] +#[rustc_const_stable(feature = "const_mem_size_of", since = "1.24.0")] #[cfg_attr(not(test), rustc_diagnostic_item = "mem_size_of")] pub const fn size_of() -> usize { intrinsics::size_of::() @@ -581,7 +581,7 @@ pub const unsafe fn align_of_val_raw(val: *const T) -> usize { #[inline] #[must_use] #[stable(feature = "needs_drop", since = "1.21.0")] -#[rustc_const_stable(feature = "const_needs_drop", since = "1.36.0")] +#[rustc_const_stable(feature = "const_mem_needs_drop", since = "1.36.0")] #[rustc_diagnostic_item = "needs_drop"] pub const fn needs_drop() -> bool { intrinsics::needs_drop::() diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 3665573ab0ff2..ec460286d0378 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -270,7 +270,7 @@ macro_rules! int_impl { #[doc = concat!("assert_eq!(0, 0", stringify!($SelfT), ".reverse_bits());")] /// ``` #[stable(feature = "reverse_bits", since = "1.37.0")] - #[rustc_const_stable(feature = "const_int_methods", since = "1.37.0")] + #[rustc_const_stable(feature = "reverse_bits", since = "1.37.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline(always)] @@ -603,7 +603,7 @@ macro_rules! int_impl { #[doc = concat!("assert_eq!((1", stringify!($SelfT), ").checked_div(0), None);")] /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_checked_int_methods", since = "1.52.0")] + #[rustc_const_stable(feature = "const_checked_int_div", since = "1.52.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -656,7 +656,7 @@ macro_rules! int_impl { #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_rem(-1), None);")] /// ``` #[stable(feature = "wrapping", since = "1.7.0")] - #[rustc_const_stable(feature = "const_checked_int_methods", since = "1.52.0")] + #[rustc_const_stable(feature = "const_checked_int_div", since = "1.52.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index f4f1d274d105b..8cbece0417b07 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -281,7 +281,7 @@ impl u8 { /// ``` #[must_use] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] - #[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.43.0")] + #[rustc_const_stable(feature = "const_u8_is_ascii", since = "1.43.0")] #[inline] pub const fn is_ascii(&self) -> bool { *self & 128 == 0 diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index c36529314784e..0ffbde33a0d1e 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -74,7 +74,7 @@ macro_rules! nonzero_integers { /// Returns the value as a primitive type. #[$stability] #[inline] - #[rustc_const_stable(feature = "nonzero", since = "1.34.0")] + #[rustc_const_stable(feature = "const_nonzero_get", since = "1.34.0")] pub const fn get(self) -> $Int { self.0 } diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 4751faeb93678..514ac69f7e049 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -273,7 +273,7 @@ macro_rules! uint_impl { #[doc = concat!("assert_eq!(0, 0", stringify!($SelfT), ".reverse_bits());")] /// ``` #[stable(feature = "reverse_bits", since = "1.37.0")] - #[rustc_const_stable(feature = "const_math", since = "1.37.0")] + #[rustc_const_stable(feature = "reverse_bits", since = "1.37.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline(always)] @@ -591,7 +591,7 @@ macro_rules! uint_impl { #[doc = concat!("assert_eq!(1", stringify!($SelfT), ".checked_div(0), None);")] /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_checked_int_methods", since = "1.52.0")] + #[rustc_const_stable(feature = "const_checked_int_div", since = "1.52.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -642,7 +642,7 @@ macro_rules! uint_impl { #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".checked_rem(0), None);")] /// ``` #[stable(feature = "wrapping", since = "1.7.0")] - #[rustc_const_stable(feature = "const_checked_int_methods", since = "1.52.0")] + #[rustc_const_stable(feature = "const_checked_int_div", since = "1.52.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] diff --git a/library/core/src/option.rs b/library/core/src/option.rs index acab8de8c70f5..b5ca9e35dced1 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -549,7 +549,7 @@ impl Option { #[must_use = "if you intended to assert that this has a value, consider `.unwrap()` instead"] #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_option", since = "1.48.0")] + #[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")] pub const fn is_some(&self) -> bool { matches!(*self, Some(_)) } @@ -592,7 +592,7 @@ impl Option { `.and_then(|_| panic!(\"`Option` had a value when expected `None`\"))` instead"] #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_option", since = "1.48.0")] + #[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")] pub const fn is_none(&self) -> bool { !self.is_some() } @@ -621,7 +621,7 @@ impl Option { /// println!("still can print text: {text:?}"); /// ``` #[inline] - #[rustc_const_stable(feature = "const_option", since = "1.48.0")] + #[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")] #[stable(feature = "rust1", since = "1.0.0")] pub const fn as_ref(&self) -> Option<&T> { match *self { diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 68d80022b4c80..e2a19c1b5818e 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -510,7 +510,7 @@ pub const fn null_mut() -> *mut T { /// see the [module documentation][crate::ptr] for details. #[inline(always)] #[must_use] -#[rustc_const_stable(feature = "strict_provenance", since = "1.61.0")] +#[rustc_const_stable(feature = "stable_things_using_strict_provenance", since = "1.61.0")] #[unstable(feature = "strict_provenance", issue = "95228")] pub const fn invalid(addr: usize) -> *const T { // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic. @@ -537,7 +537,7 @@ pub const fn invalid(addr: usize) -> *const T { /// see the [module documentation][crate::ptr] for details. #[inline(always)] #[must_use] -#[rustc_const_stable(feature = "strict_provenance", since = "1.61.0")] +#[rustc_const_stable(feature = "stable_things_using_strict_provenance", since = "1.61.0")] #[unstable(feature = "strict_provenance", issue = "95228")] pub const fn invalid_mut(addr: usize) -> *mut T { // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic. diff --git a/library/core/src/result.rs b/library/core/src/result.rs index afd0c8572291d..641749be36637 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -536,7 +536,7 @@ impl Result { /// assert_eq!(x.is_ok(), false); /// ``` #[must_use = "if you intended to assert that this is ok, consider `.unwrap()` instead"] - #[rustc_const_stable(feature = "const_result", since = "1.48.0")] + #[rustc_const_stable(feature = "const_result_basics", since = "1.48.0")] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub const fn is_ok(&self) -> bool { @@ -580,7 +580,7 @@ impl Result { /// assert_eq!(x.is_err(), true); /// ``` #[must_use = "if you intended to assert that this is err, consider `.unwrap_err()` instead"] - #[rustc_const_stable(feature = "const_result", since = "1.48.0")] + #[rustc_const_stable(feature = "const_result_basics", since = "1.48.0")] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub const fn is_err(&self) -> bool { @@ -698,7 +698,7 @@ impl Result { /// assert_eq!(x.as_ref(), Err(&"Error")); /// ``` #[inline] - #[rustc_const_stable(feature = "const_result", since = "1.48.0")] + #[rustc_const_stable(feature = "const_result_basics", since = "1.48.0")] #[stable(feature = "rust1", since = "1.0.0")] pub const fn as_ref(&self) -> Result<&T, &E> { match *self { diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs index c11a35ab947a8..6285d1c1cbb56 100644 --- a/library/core/src/sync/atomic.rs +++ b/library/core/src/sync/atomic.rs @@ -2498,7 +2498,7 @@ macro_rules! atomic_int_ptr_sized { stable(feature = "atomic_access", since = "1.15.0"), stable(feature = "atomic_from", since = "1.23.0"), stable(feature = "atomic_nand", since = "1.27.0"), - rustc_const_stable(feature = "const_integer_atomics", since = "1.24.0"), + rustc_const_stable(feature = "const_ptr_sized_atomics", since = "1.24.0"), stable(feature = "rust1", since = "1.0.0"), "isize", "", @@ -2518,7 +2518,7 @@ macro_rules! atomic_int_ptr_sized { stable(feature = "atomic_access", since = "1.15.0"), stable(feature = "atomic_from", since = "1.23.0"), stable(feature = "atomic_nand", since = "1.27.0"), - rustc_const_stable(feature = "const_integer_atomics", since = "1.24.0"), + rustc_const_stable(feature = "const_ptr_sized_atomics", since = "1.24.0"), stable(feature = "rust1", since = "1.0.0"), "usize", "", diff --git a/library/core/src/time.rs b/library/core/src/time.rs index bd72d82b71c00..6c97305b1a849 100644 --- a/library/core/src/time.rs +++ b/library/core/src/time.rs @@ -333,7 +333,7 @@ impl Duration { /// /// [`subsec_nanos`]: Duration::subsec_nanos #[stable(feature = "duration", since = "1.3.0")] - #[rustc_const_stable(feature = "duration", since = "1.32.0")] + #[rustc_const_stable(feature = "duration_consts", since = "1.32.0")] #[must_use] #[inline] pub const fn as_secs(&self) -> u64 { @@ -356,7 +356,7 @@ impl Duration { /// assert_eq!(duration.subsec_millis(), 432); /// ``` #[stable(feature = "duration_extras", since = "1.27.0")] - #[rustc_const_stable(feature = "duration_extras", since = "1.32.0")] + #[rustc_const_stable(feature = "duration_consts", since = "1.32.0")] #[must_use] #[inline] pub const fn subsec_millis(&self) -> u32 { @@ -379,7 +379,7 @@ impl Duration { /// assert_eq!(duration.subsec_micros(), 234_567); /// ``` #[stable(feature = "duration_extras", since = "1.27.0")] - #[rustc_const_stable(feature = "duration_extras", since = "1.32.0")] + #[rustc_const_stable(feature = "duration_consts", since = "1.32.0")] #[must_use] #[inline] pub const fn subsec_micros(&self) -> u32 { @@ -402,7 +402,7 @@ impl Duration { /// assert_eq!(duration.subsec_nanos(), 10_000_000); /// ``` #[stable(feature = "duration", since = "1.3.0")] - #[rustc_const_stable(feature = "duration", since = "1.32.0")] + #[rustc_const_stable(feature = "duration_consts", since = "1.32.0")] #[must_use] #[inline] pub const fn subsec_nanos(&self) -> u32 { diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index 5f90a76ab74ee..0d88a88376ab7 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -13,7 +13,6 @@ #![feature(const_convert)] #![feature(const_heap)] #![feature(const_maybe_uninit_as_mut_ptr)] -#![feature(const_maybe_uninit_assume_init)] #![feature(const_maybe_uninit_assume_init_read)] #![feature(const_nonnull_new)] #![feature(const_num_from_num)] diff --git a/library/std/src/net/ip.rs b/library/std/src/net/ip.rs index 70a7d7a8cabc1..036f291997607 100644 --- a/library/std/src/net/ip.rs +++ b/library/std/src/net/ip.rs @@ -235,7 +235,7 @@ impl IpAddr { /// assert_eq!(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)).is_unspecified(), true); /// assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)).is_unspecified(), true); /// ``` - #[rustc_const_stable(feature = "const_ip", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "ip_shared", since = "1.12.0")] #[must_use] #[inline] @@ -259,7 +259,7 @@ impl IpAddr { /// assert_eq!(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)).is_loopback(), true); /// assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0x1)).is_loopback(), true); /// ``` - #[rustc_const_stable(feature = "const_ip", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "ip_shared", since = "1.12.0")] #[must_use] #[inline] @@ -309,7 +309,7 @@ impl IpAddr { /// assert_eq!(IpAddr::V4(Ipv4Addr::new(224, 254, 0, 0)).is_multicast(), true); /// assert_eq!(IpAddr::V6(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0)).is_multicast(), true); /// ``` - #[rustc_const_stable(feature = "const_ip", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "ip_shared", since = "1.12.0")] #[must_use] #[inline] @@ -387,7 +387,7 @@ impl IpAddr { /// assert_eq!(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 6)).is_ipv4(), true); /// assert_eq!(IpAddr::V6(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0)).is_ipv4(), false); /// ``` - #[rustc_const_stable(feature = "const_ip", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "ipaddr_checker", since = "1.16.0")] #[must_use] #[inline] @@ -408,7 +408,7 @@ impl IpAddr { /// assert_eq!(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 6)).is_ipv6(), false); /// assert_eq!(IpAddr::V6(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0)).is_ipv6(), true); /// ``` - #[rustc_const_stable(feature = "const_ip", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "ipaddr_checker", since = "1.16.0")] #[must_use] #[inline] @@ -454,7 +454,7 @@ impl Ipv4Addr { /// /// let addr = Ipv4Addr::new(127, 0, 0, 1); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.32.0")] + #[rustc_const_stable(feature = "const_ip_32", since = "1.32.0")] #[stable(feature = "rust1", since = "1.0.0")] #[must_use] #[inline] @@ -516,7 +516,7 @@ impl Ipv4Addr { /// let addr = Ipv4Addr::new(127, 0, 0, 1); /// assert_eq!(addr.octets(), [127, 0, 0, 1]); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "rust1", since = "1.0.0")] #[must_use] #[inline] @@ -540,7 +540,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(0, 0, 0, 0).is_unspecified(), true); /// assert_eq!(Ipv4Addr::new(45, 22, 13, 197).is_unspecified(), false); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.32.0")] + #[rustc_const_stable(feature = "const_ip_32", since = "1.32.0")] #[stable(feature = "ip_shared", since = "1.12.0")] #[must_use] #[inline] @@ -562,7 +562,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(127, 0, 0, 1).is_loopback(), true); /// assert_eq!(Ipv4Addr::new(45, 22, 13, 197).is_loopback(), false); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(since = "1.7.0", feature = "ip_17")] #[must_use] #[inline] @@ -593,7 +593,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(192, 168, 0, 2).is_private(), true); /// assert_eq!(Ipv4Addr::new(192, 169, 0, 2).is_private(), false); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(since = "1.7.0", feature = "ip_17")] #[must_use] #[inline] @@ -621,7 +621,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(169, 254, 10, 65).is_link_local(), true); /// assert_eq!(Ipv4Addr::new(16, 89, 10, 65).is_link_local(), false); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(since = "1.7.0", feature = "ip_17")] #[must_use] #[inline] @@ -823,7 +823,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(236, 168, 10, 65).is_multicast(), true); /// assert_eq!(Ipv4Addr::new(172, 16, 10, 65).is_multicast(), false); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(since = "1.7.0", feature = "ip_17")] #[must_use] #[inline] @@ -845,7 +845,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(255, 255, 255, 255).is_broadcast(), true); /// assert_eq!(Ipv4Addr::new(236, 168, 10, 65).is_broadcast(), false); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(since = "1.7.0", feature = "ip_17")] #[must_use] #[inline] @@ -873,7 +873,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(203, 0, 113, 6).is_documentation(), true); /// assert_eq!(Ipv4Addr::new(193, 34, 17, 19).is_documentation(), false); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(since = "1.7.0", feature = "ip_17")] #[must_use] #[inline] @@ -901,7 +901,7 @@ impl Ipv4Addr { /// Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0xc000, 0x2ff) /// ); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] @@ -928,7 +928,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(192, 0, 2, 255).to_ipv6_mapped(), /// Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc000, 0x2ff)); /// ``` - #[rustc_const_stable(feature = "const_ipv4", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] @@ -1216,7 +1216,7 @@ impl Ipv6Addr { /// /// let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff); /// ``` - #[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")] + #[rustc_const_stable(feature = "const_ip_32", since = "1.32.0")] #[stable(feature = "rust1", since = "1.0.0")] #[must_use] #[inline] @@ -1278,7 +1278,7 @@ impl Ipv6Addr { /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).segments(), /// [0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff]); /// ``` - #[rustc_const_stable(feature = "const_ipv6", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "rust1", since = "1.0.0")] #[must_use] #[inline] @@ -1315,7 +1315,7 @@ impl Ipv6Addr { /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unspecified(), false); /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0).is_unspecified(), true); /// ``` - #[rustc_const_stable(feature = "const_ipv6", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(since = "1.7.0", feature = "ip_17")] #[must_use] #[inline] @@ -1339,7 +1339,7 @@ impl Ipv6Addr { /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_loopback(), false); /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0x1).is_loopback(), true); /// ``` - #[rustc_const_stable(feature = "const_ipv6", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(since = "1.7.0", feature = "ip_17")] #[must_use] #[inline] @@ -1624,7 +1624,7 @@ impl Ipv6Addr { /// assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).is_multicast(), true); /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_multicast(), false); /// ``` - #[rustc_const_stable(feature = "const_ipv6", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(since = "1.7.0", feature = "ip_17")] #[must_use] #[inline] @@ -1693,7 +1693,7 @@ impl Ipv6Addr { /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1).to_ipv4(), /// Some(Ipv4Addr::new(0, 0, 0, 1))); /// ``` - #[rustc_const_stable(feature = "const_ipv6", since = "1.50.0")] + #[rustc_const_stable(feature = "const_ip_50", since = "1.50.0")] #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] @@ -1740,7 +1740,7 @@ impl Ipv6Addr { /// assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).octets(), /// [255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); /// ``` - #[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")] + #[rustc_const_stable(feature = "const_ip_32", since = "1.32.0")] #[stable(feature = "ipv6_to_octets", since = "1.12.0")] #[must_use] #[inline] diff --git a/src/test/rustdoc/const-display.rs b/src/test/rustdoc/const-display.rs index e3f5d07478304..8455dd9ef95f4 100644 --- a/src/test/rustdoc/const-display.rs +++ b/src/test/rustdoc/const-display.rs @@ -64,7 +64,7 @@ impl Foo { // @has 'foo/struct.Foo.html' '//*[@id="method.stable_impl"]/h4[@class="code-header"]' 'pub const fn stable_impl() -> u32' // @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)' #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "rust1", since = "1.2.0")] + #[rustc_const_stable(feature = "const2", since = "1.2.0")] pub const fn stable_impl() -> u32 { 42 } } @@ -75,12 +75,12 @@ impl Bar { // Do not show non-const stabilities that are the same as the enclosing item. // @matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.2.0$' #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "rust1", since = "1.2.0")] + #[rustc_const_stable(feature = "const2", since = "1.2.0")] pub const fn stable_impl() -> u32 { 42 } // Show const-stability even for unstable functions. // @matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.3.0$' #[unstable(feature = "foo2", issue = "none")] - #[rustc_const_stable(feature = "rust1", since = "1.3.0")] + #[rustc_const_stable(feature = "const3", since = "1.3.0")] pub const fn const_stable_unstable() -> u32 { 42 } } diff --git a/src/test/ui/consts/assert-type-intrinsics.rs b/src/test/ui/consts/assert-type-intrinsics.rs index 31ff6aed03b2f..38e5c454edf75 100644 --- a/src/test/ui/consts/assert-type-intrinsics.rs +++ b/src/test/ui/consts/assert-type-intrinsics.rs @@ -1,7 +1,7 @@ // error-pattern: any use of this value will cause an error #![feature(never_type)] -#![feature(const_maybe_uninit_assume_init, const_assert_type2)] +#![feature(const_assert_type2)] #![feature(core_intrinsics)] use std::intrinsics; diff --git a/src/test/ui/consts/const-eval/simd/insert_extract.rs b/src/test/ui/consts/const-eval/simd/insert_extract.rs index a1d6c5e51b498..3472c05d12fa8 100644 --- a/src/test/ui/consts/const-eval/simd/insert_extract.rs +++ b/src/test/ui/consts/const-eval/simd/insert_extract.rs @@ -2,7 +2,7 @@ #![feature(repr_simd)] #![feature(platform_intrinsics)] #![feature(staged_api)] -#![stable(feature = "foo", since = "1.33.7")] +#![stable(feature = "foo", since = "1.3.37")] #![allow(non_camel_case_types)] #[repr(simd)] struct i8x1(i8);