mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 10:05:06 +03:00
Rollup merge of #34875 - frewsxcv:std-slice-struct, r=GuillaumeGomez
Indicate where `std::slice` structs originate from. None
This commit is contained in:
@@ -902,6 +902,8 @@ macro_rules! make_mut_slice {
|
||||
|
||||
/// Immutable slice iterator
|
||||
///
|
||||
/// This struct is created by the [`iter`] method on [slices].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Basic usage:
|
||||
@@ -915,6 +917,9 @@ macro_rules! make_mut_slice {
|
||||
/// println!("{}", element);
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// [`iter`]: ../../std/primitive.slice.html#method.iter
|
||||
/// [slices]: ../../std/primitive.slice.html
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct Iter<'a, T: 'a> {
|
||||
ptr: *const T,
|
||||
@@ -993,6 +998,8 @@ fn clone(&self) -> Iter<'a, T> { Iter { ptr: self.ptr, end: self.end, _marker: s
|
||||
|
||||
/// Mutable slice iterator.
|
||||
///
|
||||
/// This struct is created by the [`iter_mut`] method on [slices].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Basic usage:
|
||||
@@ -1010,6 +1017,9 @@ fn clone(&self) -> Iter<'a, T> { Iter { ptr: self.ptr, end: self.end, _marker: s
|
||||
/// // We now have "[2, 3, 4]":
|
||||
/// println!("{:?}", slice);
|
||||
/// ```
|
||||
///
|
||||
/// [`iter_mut`]: ../../std/primitive.slice.html#method.iter_mut
|
||||
/// [slices]: ../../std/primitive.slice.html
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct IterMut<'a, T: 'a> {
|
||||
ptr: *mut T,
|
||||
|
||||
Reference in New Issue
Block a user