Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/core/src/iter/sources/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ use crate::iter::{FusedIterator, TrustedLen};
/// # std::io::Result::Ok(())
/// ```
#[stable(feature = "iter_once", since = "1.2.0")]
#[rustc_diagnostic_item = "iter_once"]
pub fn once<T>(value: T) -> Once<T> {
Once { inner: Some(value).into_iter() }
}
Expand Down
1 change: 1 addition & 0 deletions library/core/src/iter/sources/once_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ use crate::iter::{FusedIterator, TrustedLen};
/// ```
#[inline]
#[stable(feature = "iter_once_with", since = "1.43.0")]
#[rustc_diagnostic_item = "iter_once_with"]
pub fn once_with<A, F: FnOnce() -> A>(make: F) -> OnceWith<F> {
OnceWith { make: Some(make) }
}
Expand Down
1 change: 1 addition & 0 deletions library/core/src/iter/sources/repeat_n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ use crate::ops::Try;
/// ```
#[inline]
#[stable(feature = "iter_repeat_n", since = "1.82.0")]
#[rustc_diagnostic_item = "iter_repeat_n"]
pub fn repeat_n<T: Clone>(element: T, count: usize) -> RepeatN<T> {
RepeatN { inner: RepeatNInner::new(element, count) }
}
Expand Down
27 changes: 27 additions & 0 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ pub const trait Iterator {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_nth"]
fn nth(&mut self, n: usize) -> Option<Self::Item>
where
Self::Item: [const] Destruct,
Expand Down Expand Up @@ -450,6 +451,7 @@ pub const trait Iterator {
#[inline]
#[stable(feature = "iterator_step_by", since = "1.28.0")]
#[rustc_non_const_trait_method]
#[rustc_diagnostic_item = "iter_step_by"]
fn step_by(self, step: usize) -> StepBy<Self>
where
Self: Sized,
Expand Down Expand Up @@ -521,6 +523,7 @@ pub const trait Iterator {
/// [`OsStr`]: ../../std/ffi/struct.OsStr.html
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_chain"]
fn chain<U>(self, other: U) -> Chain<Self, U::IntoIter>
where
Self: Sized,
Expand Down Expand Up @@ -640,6 +643,7 @@ pub const trait Iterator {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_non_const_trait_method]
#[rustc_diagnostic_item = "iter_zip"]
fn zip<U>(self, other: U) -> Zip<Self, U::IntoIter>
where
Self: Sized,
Expand Down Expand Up @@ -888,6 +892,7 @@ pub const trait Iterator {
#[inline]
#[stable(feature = "iterator_for_each", since = "1.21.0")]
#[rustc_non_const_trait_method]
#[rustc_diagnostic_item = "iter_for_each"]
fn for_each<F>(self, f: F)
where
Self: Sized,
Expand Down Expand Up @@ -1008,6 +1013,7 @@ pub const trait Iterator {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_filter_map"]
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where
Self: Sized,
Expand Down Expand Up @@ -1191,6 +1197,7 @@ pub const trait Iterator {
#[inline]
#[doc(alias = "drop_while")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_skip_while"]
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where
Self: Sized,
Expand Down Expand Up @@ -1269,6 +1276,7 @@ pub const trait Iterator {
/// the iteration should stop, but wasn't placed back into the iterator.
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "take_while"]
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where
Self: Sized,
Expand Down Expand Up @@ -1357,6 +1365,7 @@ pub const trait Iterator {
/// [`fuse`]: Iterator::fuse
#[inline]
#[stable(feature = "iter_map_while", since = "1.57.0")]
#[rustc_diagnostic_item = "iter_map_while"]
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where
Self: Sized,
Expand Down Expand Up @@ -1386,6 +1395,7 @@ pub const trait Iterator {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_skip"]
fn skip(self, n: usize) -> Skip<Self>
where
Self: Sized,
Expand Down Expand Up @@ -1458,6 +1468,7 @@ pub const trait Iterator {
#[doc(alias = "limit")]
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_take"]
fn take(self, n: usize) -> Take<Self>
where
Self: Sized,
Expand Down Expand Up @@ -1505,6 +1516,7 @@ pub const trait Iterator {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_scan"]
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where
Self: Sized,
Expand Down Expand Up @@ -1544,6 +1556,7 @@ pub const trait Iterator {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_non_const_trait_method]
#[rustc_diagnostic_item = "iter_flat_map"]
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where
Self: Sized,
Expand Down Expand Up @@ -1628,6 +1641,7 @@ pub const trait Iterator {
/// [`flat_map()`]: Iterator::flat_map
#[inline]
#[stable(feature = "iterator_flatten", since = "1.29.0")]
#[rustc_diagnostic_item = "iter_flatten"]
fn flatten(self) -> Flatten<Self>
where
Self: Sized,
Expand Down Expand Up @@ -1840,6 +1854,7 @@ pub const trait Iterator {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_fuse"]
fn fuse(self) -> Fuse<Self>
where
Self: Sized,
Expand Down Expand Up @@ -1924,6 +1939,7 @@ pub const trait Iterator {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "inspect"]
fn inspect<F>(self, f: F) -> Inspect<Self, F>
where
Self: Sized,
Expand Down Expand Up @@ -2278,6 +2294,7 @@ pub const trait Iterator {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_non_const_trait_method]
#[rustc_diagnostic_item = "iter_partition"]
fn partition<B, F>(self, f: F) -> (B, B)
where
Self: Sized,
Expand Down Expand Up @@ -2493,6 +2510,7 @@ pub const trait Iterator {
/// ```
#[inline]
#[stable(feature = "iterator_try_fold", since = "1.27.0")]
#[rustc_diagnostic_item = "iter_try_fold"]
fn try_fold<B, F, R>(&mut self, init: B, mut f: F) -> R
where
Self: Sized,
Expand Down Expand Up @@ -2552,6 +2570,7 @@ pub const trait Iterator {
#[inline]
#[stable(feature = "iterator_try_fold", since = "1.27.0")]
#[rustc_non_const_trait_method]
#[rustc_diagnostic_item = "iter_try_for_each"]
fn try_for_each<F, R>(&mut self, f: F) -> R
where
Self: Sized,
Expand Down Expand Up @@ -2671,6 +2690,7 @@ pub const trait Iterator {
#[doc(alias = "inject", alias = "foldl")]
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_fold"]
fn fold<B, F>(mut self, init: B, mut f: F) -> B
where
Self: Sized + [const] Destruct,
Expand Down Expand Up @@ -2708,6 +2728,7 @@ pub const trait Iterator {
/// ```
#[inline]
#[stable(feature = "iterator_fold_self", since = "1.51.0")]
#[rustc_diagnostic_item = "iter_reduce"]
fn reduce<F>(mut self, f: F) -> Option<Self::Item>
where
Self: Sized + [const] Destruct,
Expand Down Expand Up @@ -2837,6 +2858,7 @@ pub const trait Iterator {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "iter_all"]
fn all<F>(&mut self, f: F) -> bool
where
Self: Sized,
Expand Down Expand Up @@ -2894,6 +2916,7 @@ pub const trait Iterator {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_non_const_trait_method]
#[rustc_diagnostic_item = "iter_any"]
fn any<F>(&mut self, f: F) -> bool
where
Self: Sized,
Expand Down Expand Up @@ -3607,6 +3630,7 @@ pub const trait Iterator {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
#[rustc_diagnostic_item = "iter_cycle"]
fn cycle(self) -> Cycle<Self>
where
Self: Sized + [const] Clone,
Expand Down Expand Up @@ -3650,6 +3674,7 @@ pub const trait Iterator {
/// ```
#[track_caller]
#[unstable(feature = "iter_array_chunks", issue = "100450")]
#[rustc_diagnostic_item = "iter_array_chunks"]
fn array_chunks<#[rustc_panics_when_zero] const N: usize>(self) -> ArrayChunks<Self, N>
where
Self: Sized,
Expand Down Expand Up @@ -3686,6 +3711,7 @@ pub const trait Iterator {
/// assert_eq!(sum, -0.0_f32);
/// ```
#[stable(feature = "iter_arith", since = "1.11.0")]
#[rustc_diagnostic_item = "iter_sum"]
fn sum<S>(self) -> S
where
Self: Sized,
Expand Down Expand Up @@ -3718,6 +3744,7 @@ pub const trait Iterator {
/// assert_eq!(factorial(5), 120);
/// ```
#[stable(feature = "iter_arith", since = "1.11.0")]
#[rustc_diagnostic_item = "iter_product"]
fn product<P>(self) -> P
where
Self: Sized,
Expand Down
Loading