Skip to content

Commit 844f131

Browse files
committed
Auto merge of #151228 - cyrgani:less-feature, r=jhpratt
remove multiple unhelpful `reason = "..."` values from `#[unstable(...)]` invocations The vast majority of `#[unstable()]` attributes already has no explicit reason specified. This PR removes the `reason = "..."` value for the following unhelpful or meaningless reasons: * "recently added" * "new API" * "recently redesigned" * "unstable" An example of how the message looks with and without a reason: ```rust fn main() { Vec::<()>::into_parts; Vec::<()>::const_make_global; } ``` ``` error[E0658]: use of unstable library feature `box_vec_non_null`: new API --> src/main.rs:2:5 | 2 | Vec::<()>::into_parts; | ^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #130364 <#130364> for more information = help: add `#![feature(box_vec_non_null)]` to the crate attributes to enable = note: this compiler was built on 2026-01-15; consider upgrading it if it is out of date error[E0658]: use of unstable library feature `const_heap` --> src/main.rs:3:5 | 3 | Vec::<()>::const_make_global; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #79597 <#79597> for more information = help: add `#![feature(const_heap)]` to the crate attributes to enable = note: this compiler was built on 2026-01-15; consider upgrading it if it is out of date ``` Most of the remaining reasons after this are something similar to "this is an implementation detail for XYZ" or "this is not public". If this PR is approved, I'll look into those next. The PR also removes the `fd_read` feature gate. It only consists of one attribute applied to an implementation inside a module that is already private and unstable and should not be needed.
2 parents defdb83 + 035bcfa commit 844f131

19 files changed

Lines changed: 66 additions & 72 deletions

File tree

library/alloc/src/boxed.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ impl<T: ?Sized> Box<T> {
13131313
/// ```
13141314
///
13151315
/// [memory layout]: self#memory-layout
1316-
#[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
1316+
#[unstable(feature = "box_vec_non_null", issue = "130364")]
13171317
#[inline]
13181318
#[must_use = "call `drop(Box::from_non_null(ptr))` if you intend to drop the `Box`"]
13191319
pub unsafe fn from_non_null(ptr: NonNull<T>) -> Self {
@@ -1431,7 +1431,7 @@ impl<T: ?Sized> Box<T> {
14311431
///
14321432
/// [memory layout]: self#memory-layout
14331433
#[must_use = "losing the pointer will leak memory"]
1434-
#[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
1434+
#[unstable(feature = "box_vec_non_null", issue = "130364")]
14351435
#[inline]
14361436
pub fn into_non_null(b: Self) -> NonNull<T> {
14371437
// SAFETY: `Box` is guaranteed to be non-null.
@@ -1540,7 +1540,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
15401540
///
15411541
/// [memory layout]: self#memory-layout
15421542
#[unstable(feature = "allocator_api", issue = "32838")]
1543-
// #[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
1543+
// #[unstable(feature = "box_vec_non_null", issue = "130364")]
15441544
#[inline]
15451545
pub unsafe fn from_non_null_in(raw: NonNull<T>, alloc: A) -> Self {
15461546
// SAFETY: guaranteed by the caller.
@@ -1655,7 +1655,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
16551655
/// [memory layout]: self#memory-layout
16561656
#[must_use = "losing the pointer will leak memory"]
16571657
#[unstable(feature = "allocator_api", issue = "32838")]
1658-
// #[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
1658+
// #[unstable(feature = "box_vec_non_null", issue = "130364")]
16591659
#[inline]
16601660
pub fn into_non_null_with_allocator(b: Self) -> (NonNull<T>, A) {
16611661
let (ptr, alloc) = Box::into_raw_with_allocator(b);

library/alloc/src/collections/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl const From<TryReserveErrorKind> for TryReserveError {
156156
}
157157
}
158158

159-
#[unstable(feature = "try_reserve_kind", reason = "new API", issue = "48043")]
159+
#[unstable(feature = "try_reserve_kind", issue = "48043")]
160160
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]
161161
#[cfg(not(test))]
162162
impl const From<LayoutError> for TryReserveErrorKind {

library/alloc/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,7 @@ impl String {
15631563
/// assert_eq!("bna", s);
15641564
/// ```
15651565
#[cfg(not(no_global_oom_handling))]
1566-
#[unstable(feature = "string_remove_matches", reason = "new API", issue = "72826")]
1566+
#[unstable(feature = "string_remove_matches", issue = "72826")]
15671567
pub fn remove_matches<P: Pattern>(&mut self, pat: P) {
15681568
use core::str::pattern::Searcher;
15691569

library/alloc/src/vec/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ impl<T> Vec<T> {
743743
/// }
744744
/// ```
745745
#[inline]
746-
#[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
746+
#[unstable(feature = "box_vec_non_null", issue = "130364")]
747747
pub unsafe fn from_parts(ptr: NonNull<T>, length: usize, capacity: usize) -> Self {
748748
unsafe { Self::from_parts_in(ptr, length, capacity, Global) }
749749
}
@@ -793,7 +793,7 @@ impl<T> Vec<T> {
793793
/// ```
794794
#[cfg(not(no_global_oom_handling))]
795795
#[inline]
796-
#[unstable(feature = "vec_from_fn", reason = "new API", issue = "149698")]
796+
#[unstable(feature = "vec_from_fn", issue = "149698")]
797797
pub fn from_fn<F>(length: usize, f: F) -> Self
798798
where
799799
F: FnMut(usize) -> T,
@@ -878,7 +878,7 @@ impl<T> Vec<T> {
878878
/// assert_eq!(rebuilt, [4294967295, 0, 1]);
879879
/// ```
880880
#[must_use = "losing the pointer will leak memory"]
881-
#[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
881+
#[unstable(feature = "box_vec_non_null", issue = "130364")]
882882
pub fn into_parts(self) -> (NonNull<T>, usize, usize) {
883883
let (ptr, len, capacity) = self.into_raw_parts();
884884
// SAFETY: A `Vec` always has a non-null pointer.
@@ -1291,7 +1291,7 @@ impl<T, A: Allocator> Vec<T, A> {
12911291
/// }
12921292
/// ```
12931293
#[inline]
1294-
#[unstable(feature = "allocator_api", reason = "new API", issue = "32838")]
1294+
#[unstable(feature = "allocator_api", issue = "32838")]
12951295
// #[unstable(feature = "box_vec_non_null", issue = "130364")]
12961296
pub unsafe fn from_parts_in(ptr: NonNull<T>, length: usize, capacity: usize, alloc: A) -> Self {
12971297
ub_checks::assert_unsafe_precondition!(
@@ -1390,7 +1390,7 @@ impl<T, A: Allocator> Vec<T, A> {
13901390
/// ```
13911391
#[must_use = "losing the pointer will leak memory"]
13921392
#[unstable(feature = "allocator_api", issue = "32838")]
1393-
// #[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
1393+
// #[unstable(feature = "box_vec_non_null", issue = "130364")]
13941394
pub fn into_parts_with_alloc(self) -> (NonNull<T>, usize, usize, A) {
13951395
let (ptr, len, capacity, alloc) = self.into_raw_parts_with_alloc();
13961396
// SAFETY: A `Vec` always has a non-null pointer.
@@ -1994,8 +1994,8 @@ impl<T, A: Allocator> Vec<T, A> {
19941994
/// [`as_mut_ptr`]: Vec::as_mut_ptr
19951995
/// [`as_ptr`]: Vec::as_ptr
19961996
/// [`as_non_null`]: Vec::as_non_null
1997-
#[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
1998-
#[rustc_const_unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
1997+
#[unstable(feature = "box_vec_non_null", issue = "130364")]
1998+
#[rustc_const_unstable(feature = "box_vec_non_null", issue = "130364")]
19991999
#[inline]
20002000
pub const fn as_non_null(&mut self) -> NonNull<T> {
20012001
self.buf.non_null()

library/core/src/iter/adapters/array_chunks.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::ops::{ControlFlow, NeverShortCircuit, Try};
1515
/// method on [`Iterator`]. See its documentation for more.
1616
#[derive(Debug, Clone)]
1717
#[must_use = "iterators are lazy and do nothing unless consumed"]
18-
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
18+
#[unstable(feature = "iter_array_chunks", issue = "100450")]
1919
pub struct ArrayChunks<I: Iterator, const N: usize> {
2020
iter: I,
2121
remainder: Option<array::IntoIter<I::Item, N>>,
@@ -44,7 +44,7 @@ where
4444
/// assert_eq!(rem.next(), Some(5));
4545
/// assert_eq!(rem.next(), None);
4646
/// ```
47-
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
47+
#[unstable(feature = "iter_array_chunks", issue = "100450")]
4848
#[inline]
4949
pub fn into_remainder(mut self) -> array::IntoIter<I::Item, N> {
5050
if self.remainder.is_none() {
@@ -54,7 +54,7 @@ where
5454
}
5555
}
5656

57-
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
57+
#[unstable(feature = "iter_array_chunks", issue = "100450")]
5858
impl<I, const N: usize> Iterator for ArrayChunks<I, N>
5959
where
6060
I: Iterator,
@@ -108,7 +108,7 @@ where
108108
}
109109
}
110110

111-
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
111+
#[unstable(feature = "iter_array_chunks", issue = "100450")]
112112
impl<I, const N: usize> DoubleEndedIterator for ArrayChunks<I, N>
113113
where
114114
I: DoubleEndedIterator + ExactSizeIterator,
@@ -173,13 +173,13 @@ where
173173
}
174174
}
175175

176-
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
176+
#[unstable(feature = "iter_array_chunks", issue = "100450")]
177177
impl<I, const N: usize> FusedIterator for ArrayChunks<I, N> where I: FusedIterator {}
178178

179179
#[unstable(issue = "none", feature = "trusted_fused")]
180180
unsafe impl<I, const N: usize> TrustedFused for ArrayChunks<I, N> where I: TrustedFused + Iterator {}
181181

182-
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
182+
#[unstable(feature = "iter_array_chunks", issue = "100450")]
183183
impl<I, const N: usize> ExactSizeIterator for ArrayChunks<I, N>
184184
where
185185
I: ExactSizeIterator,

library/core/src/iter/adapters/intersperse.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::iter::{Fuse, FusedIterator};
55
///
66
/// This `struct` is created by [`Iterator::intersperse`]. See its documentation
77
/// for more information.
8-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
8+
#[unstable(feature = "iter_intersperse", issue = "79524")]
99
#[derive(Debug, Clone)]
1010
pub struct Intersperse<I: Iterator>
1111
where
@@ -17,7 +17,7 @@ where
1717
iter: Fuse<I>,
1818
}
1919

20-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
20+
#[unstable(feature = "iter_intersperse", issue = "79524")]
2121
impl<I> FusedIterator for Intersperse<I>
2222
where
2323
I: FusedIterator,
@@ -34,7 +34,7 @@ where
3434
}
3535
}
3636

37-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
37+
#[unstable(feature = "iter_intersperse", issue = "79524")]
3838
impl<I> Iterator for Intersperse<I>
3939
where
4040
I: Iterator,
@@ -87,7 +87,7 @@ where
8787
///
8888
/// This `struct` is created by [`Iterator::intersperse_with`]. See its
8989
/// documentation for more information.
90-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
90+
#[unstable(feature = "iter_intersperse", issue = "79524")]
9191
pub struct IntersperseWith<I, G>
9292
where
9393
I: Iterator,
@@ -98,15 +98,15 @@ where
9898
iter: Fuse<I>,
9999
}
100100

101-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
101+
#[unstable(feature = "iter_intersperse", issue = "79524")]
102102
impl<I, G> FusedIterator for IntersperseWith<I, G>
103103
where
104104
I: FusedIterator,
105105
G: FnMut() -> I::Item,
106106
{
107107
}
108108

109-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
109+
#[unstable(feature = "iter_intersperse", issue = "79524")]
110110
impl<I, G> fmt::Debug for IntersperseWith<I, G>
111111
where
112112
I: Iterator + fmt::Debug,
@@ -123,7 +123,7 @@ where
123123
}
124124
}
125125

126-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
126+
#[unstable(feature = "iter_intersperse", issue = "79524")]
127127
impl<I, G> Clone for IntersperseWith<I, G>
128128
where
129129
I: Iterator + Clone,
@@ -150,7 +150,7 @@ where
150150
}
151151
}
152152

153-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
153+
#[unstable(feature = "iter_intersperse", issue = "79524")]
154154
impl<I, G> Iterator for IntersperseWith<I, G>
155155
where
156156
I: Iterator,

library/core/src/iter/adapters/map_windows.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::{fmt, ptr};
77
/// This `struct` is created by the [`Iterator::map_windows`]. See its
88
/// documentation for more information.
99
#[must_use = "iterators are lazy and do nothing unless consumed"]
10-
#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
10+
#[unstable(feature = "iter_map_windows", issue = "87155")]
1111
pub struct MapWindows<I: Iterator, F, const N: usize> {
1212
f: F,
1313
inner: MapWindowsInner<I, N>,
@@ -234,7 +234,7 @@ impl<T, const N: usize> Drop for Buffer<T, N> {
234234
}
235235
}
236236

237-
#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
237+
#[unstable(feature = "iter_map_windows", issue = "87155")]
238238
impl<I, F, R, const N: usize> Iterator for MapWindows<I, F, N>
239239
where
240240
I: Iterator,
@@ -255,30 +255,30 @@ where
255255

256256
// Note that even if the inner iterator not fused, the `MapWindows` is still fused,
257257
// because we don't allow "holes" in the mapping window.
258-
#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
258+
#[unstable(feature = "iter_map_windows", issue = "87155")]
259259
impl<I, F, R, const N: usize> FusedIterator for MapWindows<I, F, N>
260260
where
261261
I: Iterator,
262262
F: FnMut(&[I::Item; N]) -> R,
263263
{
264264
}
265265

266-
#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
266+
#[unstable(feature = "iter_map_windows", issue = "87155")]
267267
impl<I, F, R, const N: usize> ExactSizeIterator for MapWindows<I, F, N>
268268
where
269269
I: ExactSizeIterator,
270270
F: FnMut(&[I::Item; N]) -> R,
271271
{
272272
}
273273

274-
#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
274+
#[unstable(feature = "iter_map_windows", issue = "87155")]
275275
impl<I: Iterator + fmt::Debug, F, const N: usize> fmt::Debug for MapWindows<I, F, N> {
276276
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
277277
f.debug_struct("MapWindows").field("iter", &self.inner.iter).finish()
278278
}
279279
}
280280

281-
#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
281+
#[unstable(feature = "iter_map_windows", issue = "87155")]
282282
impl<I, F, const N: usize> Clone for MapWindows<I, F, N>
283283
where
284284
I: Iterator + Clone,

library/core/src/iter/adapters/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod take;
2828
mod take_while;
2929
mod zip;
3030

31-
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
31+
#[unstable(feature = "iter_array_chunks", issue = "100450")]
3232
pub use self::array_chunks::ArrayChunks;
3333
#[unstable(feature = "std_internals", issue = "none")]
3434
pub use self::by_ref_sized::ByRefSized;
@@ -40,11 +40,11 @@ pub use self::cloned::Cloned;
4040
pub use self::copied::Copied;
4141
#[stable(feature = "iterator_flatten", since = "1.29.0")]
4242
pub use self::flatten::Flatten;
43-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
43+
#[unstable(feature = "iter_intersperse", issue = "79524")]
4444
pub use self::intersperse::{Intersperse, IntersperseWith};
4545
#[stable(feature = "iter_map_while", since = "1.57.0")]
4646
pub use self::map_while::MapWhile;
47-
#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
47+
#[unstable(feature = "iter_map_windows", issue = "87155")]
4848
pub use self::map_windows::MapWindows;
4949
#[stable(feature = "iterator_step_by", since = "1.28.0")]
5050
pub use self::step_by::StepBy;

library/core/src/iter/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ macro_rules! impl_fold_via_try_fold {
382382
};
383383
}
384384

385-
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
385+
#[unstable(feature = "iter_array_chunks", issue = "100450")]
386386
pub use self::adapters::ArrayChunks;
387387
#[unstable(feature = "std_internals", issue = "none")]
388388
pub use self::adapters::ByRefSized;
@@ -394,7 +394,7 @@ pub use self::adapters::Copied;
394394
pub use self::adapters::Flatten;
395395
#[stable(feature = "iter_map_while", since = "1.57.0")]
396396
pub use self::adapters::MapWhile;
397-
#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
397+
#[unstable(feature = "iter_map_windows", issue = "87155")]
398398
pub use self::adapters::MapWindows;
399399
#[unstable(feature = "inplace_iteration", issue = "none")]
400400
pub use self::adapters::SourceIter;
@@ -414,7 +414,7 @@ pub use self::adapters::{
414414
Chain, Cycle, Enumerate, Filter, FilterMap, FlatMap, Fuse, Inspect, Map, Peekable, Rev, Scan,
415415
Skip, SkipWhile, Take, TakeWhile, Zip,
416416
};
417-
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
417+
#[unstable(feature = "iter_intersperse", issue = "79524")]
418418
pub use self::adapters::{Intersperse, IntersperseWith};
419419
#[unstable(
420420
feature = "step_trait",

0 commit comments

Comments
 (0)