From c1ac7693f6d1637fbc512dc025f69ba2e1389e01 Mon Sep 17 00:00:00 2001 From: okaneco <47607823+okaneco@users.noreply.github.com> Date: Wed, 8 Apr 2026 15:55:00 -0400 Subject: [PATCH] Fix feature name for unstable `integer_extend_truncate` functions The feature name for the const unstable attribute was accidentally transposed when const traits were added. --- library/core/src/num/int_macros.rs | 8 ++++---- library/core/src/num/traits.rs | 8 ++++---- library/core/src/num/uint_macros.rs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index b148c7578db2..6a403542dd23 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -3958,7 +3958,7 @@ macro_rules! int_impl { /// ``` #[must_use = "this returns the truncated value and does not modify the original"] #[unstable(feature = "integer_extend_truncate", issue = "154330")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] #[inline] pub const fn truncate(self) -> Target where Self: [const] traits::TruncateTarget @@ -3980,7 +3980,7 @@ macro_rules! int_impl { /// ``` #[must_use = "this returns the truncated value and does not modify the original"] #[unstable(feature = "integer_extend_truncate", issue = "154330")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] #[inline] pub const fn saturating_truncate(self) -> Target where Self: [const] traits::TruncateTarget @@ -4002,7 +4002,7 @@ macro_rules! int_impl { /// ``` #[must_use = "this returns the truncated value and does not modify the original"] #[unstable(feature = "integer_extend_truncate", issue = "154330")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] #[inline] pub const fn checked_truncate(self) -> Option where Self: [const] traits::TruncateTarget @@ -4021,7 +4021,7 @@ macro_rules! int_impl { /// ``` #[must_use = "this returns the extended value and does not modify the original"] #[unstable(feature = "integer_extend_truncate", issue = "154330")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] #[inline] pub const fn extend(self) -> Target where Self: [const] traits::ExtendTarget diff --git a/library/core/src/num/traits.rs b/library/core/src/num/traits.rs index 9ce4d878a6e0..92217a4817b4 100644 --- a/library/core/src/num/traits.rs +++ b/library/core/src/num/traits.rs @@ -3,7 +3,7 @@ /// Trait for types that this type can be truncated to #[unstable(feature = "num_internals", reason = "internal implementation detail", issue = "none")] -#[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] +#[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] pub const trait TruncateTarget: crate::sealed::Sealed { #[doc(hidden)] fn internal_truncate(self) -> Target; @@ -17,7 +17,7 @@ pub const trait TruncateTarget: crate::sealed::Sealed { /// Trait for types that this type can be truncated to #[unstable(feature = "num_internals", reason = "internal implementation detail", issue = "none")] -#[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] +#[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] pub const trait ExtendTarget: crate::sealed::Sealed { #[doc(hidden)] fn internal_extend(self) -> Target; @@ -40,7 +40,7 @@ macro_rules! impl_truncate { ); #[unstable(feature = "num_internals", reason = "internal implementation detail", issue = "none")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] impl const TruncateTarget<$to> for $from { #[inline] fn internal_truncate(self) -> $to { @@ -87,7 +87,7 @@ macro_rules! impl_extend { ); #[unstable(feature = "num_internals", reason = "internal implementation detail", issue = "none")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] impl const ExtendTarget<$to> for $from { fn internal_extend(self) -> $to { self as _ diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index e048f8f48539..c35deee920e4 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -4120,7 +4120,7 @@ macro_rules! uint_impl { /// ``` #[must_use = "this returns the truncated value and does not modify the original"] #[unstable(feature = "integer_extend_truncate", issue = "154330")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] #[inline] pub const fn truncate(self) -> Target where Self: [const] traits::TruncateTarget @@ -4140,7 +4140,7 @@ macro_rules! uint_impl { /// ``` #[must_use = "this returns the truncated value and does not modify the original"] #[unstable(feature = "integer_extend_truncate", issue = "154330")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] #[inline] pub const fn saturating_truncate(self) -> Target where Self: [const] traits::TruncateTarget @@ -4160,7 +4160,7 @@ macro_rules! uint_impl { /// ``` #[must_use = "this returns the truncated value and does not modify the original"] #[unstable(feature = "integer_extend_truncate", issue = "154330")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] #[inline] pub const fn checked_truncate(self) -> Option where Self: [const] traits::TruncateTarget @@ -4178,7 +4178,7 @@ macro_rules! uint_impl { /// ``` #[must_use = "this returns the extended value and does not modify the original"] #[unstable(feature = "integer_extend_truncate", issue = "154330")] - #[rustc_const_unstable(feature = "integer_truncate_extend", issue = "154330")] + #[rustc_const_unstable(feature = "integer_extend_truncate", issue = "154330")] #[inline] pub const fn extend(self) -> Target where Self: [const] traits::ExtendTarget