From b3b439829c9a4df9c42786cfd818d5bc468ef32e Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Fri, 17 Apr 2026 09:35:17 +0200 Subject: [PATCH] Remove `#[inline]` from generic functions in `core::range` They shouldn't be needed according to https://std-dev-guide.rust-lang.org/policy/inline.html. --- library/core/src/range.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/library/core/src/range.rs b/library/core/src/range.rs index 1200f8922c819..499b4d4909265 100644 --- a/library/core/src/range.rs +++ b/library/core/src/range.rs @@ -104,7 +104,6 @@ impl Range { /// assert_eq!(i.next(), Some(25)); /// ``` #[stable(feature = "new_range_api", since = "CURRENT_RUSTC_VERSION")] - #[inline] pub fn iter(&self) -> RangeIter { self.clone().into_iter() } @@ -131,7 +130,6 @@ impl> Range { /// assert!(!Range::from(0.0..f32::NAN).contains(&0.5)); /// assert!(!Range::from(f32::NAN..1.0).contains(&0.5)); /// ``` - #[inline] #[stable(feature = "new_range_api", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_range", issue = "none")] pub const fn contains(&self, item: &U) -> bool @@ -163,7 +161,6 @@ impl> Range { /// assert!( Range::from(3.0..f32::NAN).is_empty()); /// assert!( Range::from(f32::NAN..5.0).is_empty()); /// ``` - #[inline] #[stable(feature = "new_range_api", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_range", issue = "none")] pub const fn is_empty(&self) -> bool @@ -213,7 +210,6 @@ impl const IntoBounds for Range { #[stable(feature = "new_range_api", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] impl const From> for legacy::Range { - #[inline] fn from(value: Range) -> Self { Self { start: value.start, end: value.end } } @@ -221,7 +217,6 @@ impl const From> for legacy::Range { #[stable(feature = "new_range_api", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] impl const From> for Range { - #[inline] fn from(value: legacy::Range) -> Self { Self { start: value.start, end: value.end } } @@ -289,7 +284,6 @@ impl> RangeInclusive { /// assert!(!RangeInclusive::from(0.0..=f32::NAN).contains(&0.0)); /// assert!(!RangeInclusive::from(f32::NAN..=1.0).contains(&1.0)); /// ``` - #[inline] #[stable(feature = "new_range_inclusive_api", since = "1.95.0")] #[rustc_const_unstable(feature = "const_range", issue = "none")] pub const fn contains(&self, item: &U) -> bool @@ -322,7 +316,6 @@ impl> RangeInclusive { /// assert!( RangeInclusive::from(f32::NAN..=5.0).is_empty()); /// ``` #[stable(feature = "new_range_inclusive_api", since = "1.95.0")] - #[inline] #[rustc_const_unstable(feature = "const_range", issue = "none")] pub const fn is_empty(&self) -> bool where @@ -348,7 +341,6 @@ impl RangeInclusive { /// assert_eq!(i.next(), Some(25)); /// ``` #[stable(feature = "new_range_inclusive_api", since = "1.95.0")] - #[inline] pub fn iter(&self) -> RangeInclusiveIter { self.clone().into_iter() } @@ -394,7 +386,6 @@ impl const IntoBounds for RangeInclusive { #[stable(feature = "new_range_inclusive_api", since = "1.95.0")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] impl const From> for legacy::RangeInclusive { - #[inline] fn from(value: RangeInclusive) -> Self { Self::new(value.start, value.last) } @@ -402,7 +393,6 @@ impl const From> for legacy::RangeInclusive { #[stable(feature = "new_range_inclusive_api", since = "1.95.0")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] impl const From> for RangeInclusive { - #[inline] fn from(value: legacy::RangeInclusive) -> Self { assert!( !value.exhausted, @@ -476,7 +466,6 @@ impl RangeFrom { /// assert_eq!(i.next(), Some(25)); /// ``` #[stable(feature = "new_range_from_api", since = "CURRENT_RUSTC_VERSION")] - #[inline] pub fn iter(&self) -> RangeFromIter { self.clone().into_iter() } @@ -498,7 +487,6 @@ impl> RangeFrom { /// assert!(!RangeFrom::from(0.0..).contains(&f32::NAN)); /// assert!(!RangeFrom::from(f32::NAN..).contains(&0.5)); /// ``` - #[inline] #[stable(feature = "new_range_from_api", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_range", issue = "none")] pub const fn contains(&self, item: &U) -> bool @@ -560,7 +548,6 @@ where #[stable(feature = "new_range_from_api", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_index", issue = "143775")] impl const From> for legacy::RangeFrom { - #[inline] fn from(value: RangeFrom) -> Self { Self { start: value.start } } @@ -568,7 +555,6 @@ impl const From> for legacy::RangeFrom { #[stable(feature = "new_range_from_api", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_index", issue = "143775")] impl const From> for RangeFrom { - #[inline] fn from(value: legacy::RangeFrom) -> Self { Self { start: value.start } } @@ -649,7 +635,6 @@ impl> RangeToInclusive { /// assert!(!(..=1.0).contains(&f32::NAN)); /// assert!(!(..=f32::NAN).contains(&0.5)); /// ``` - #[inline] #[stable(feature = "new_range_to_inclusive_api", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_range", issue = "none")] pub const fn contains(&self, item: &U) -> bool