diff options
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/borrow.rs | 8 | ||||
| -rw-r--r-- | library/alloc/src/fmt.rs | 8 | ||||
| -rw-r--r-- | library/alloc/src/rc.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/string.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/sync.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/vec/drain.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/vec/drain_filter.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/vec/splice.rs | 2 | 
9 files changed, 16 insertions, 16 deletions
| diff --git a/library/alloc/src/borrow.rs b/library/alloc/src/borrow.rs index 0c8c796ae9b..84331eba2d4 100644 --- a/library/alloc/src/borrow.rs +++ b/library/alloc/src/borrow.rs @@ -115,7 +115,7 @@ where /// ``` /// use std::borrow::Cow; /// -/// fn abs_all(input: &mut Cow<[i32]>) { +/// fn abs_all(input: &mut Cow<'_, [i32]>) { /// for i in 0..input.len() { /// let v = input[i]; /// if v < 0 { @@ -145,7 +145,7 @@ where /// ``` /// use std::borrow::Cow; /// -/// struct Items<'a, X: 'a> where [X]: ToOwned<Owned = Vec<X>> { +/// struct Items<'a, X> where [X]: ToOwned<Owned = Vec<X>> { /// values: Cow<'a, [X]>, /// } /// @@ -267,7 +267,7 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> { /// /// assert_eq!( /// cow, - /// Cow::Owned(String::from("FOO")) as Cow<str> + /// Cow::Owned(String::from("FOO")) as Cow<'_, str> /// ); /// ``` #[stable(feature = "rust1", since = "1.0.0")] @@ -311,7 +311,7 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> { /// use std::borrow::Cow; /// /// let s = "Hello world!"; - /// let cow: Cow<str> = Cow::Owned(String::from(s)); + /// let cow: Cow<'_, str> = Cow::Owned(String::from(s)); /// /// assert_eq!( /// cow.into_owned(), diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs index e03b501ae4d..fb8d00e8d87 100644 --- a/library/alloc/src/fmt.rs +++ b/library/alloc/src/fmt.rs @@ -363,7 +363,7 @@ //! # use std::fmt; //! # struct Foo; // our custom type //! # impl fmt::Display for Foo { -//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +//! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { //! # write!(f, "testing, testing") //! # } } //! ``` @@ -399,7 +399,7 @@ //! } //! //! impl fmt::Display for Vector2D { -//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +//! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { //! // The `f` value implements the `Write` trait, which is what the //! // write! macro is expecting. Note that this formatting ignores the //! // various flags provided to format strings. @@ -410,7 +410,7 @@ //! // Different traits allow different forms of output of a type. The meaning //! // of this format is to print the magnitude of a vector. //! impl fmt::Binary for Vector2D { -//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +//! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { //! let magnitude = (self.x * self.x + self.y * self.y) as f64; //! let magnitude = magnitude.sqrt(); //! @@ -517,7 +517,7 @@ //! let mut some_writer = io::stdout(); //! write!(&mut some_writer, "{}", format_args!("print with a {}", "macro")); //! -//! fn my_fmt_fn(args: fmt::Arguments) { +//! fn my_fmt_fn(args: fmt::Arguments<'_>) { //! write!(&mut io::stdout(), "{args}"); //! } //! my_fmt_fn(format_args!(", or a {} too", "function")); diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index cf93a40496f..ae3d026ac4e 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -2039,7 +2039,7 @@ where /// ```rust /// # use std::rc::Rc; /// # use std::borrow::Cow; - /// let cow: Cow<str> = Cow::Borrowed("eggplant"); + /// let cow: Cow<'_, str> = Cow::Borrowed("eggplant"); /// let shared: Rc<str> = Rc::from(cow); /// assert_eq!("eggplant", &shared[..]); /// ``` diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index cf16a3424a0..4813422e160 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -2732,7 +2732,7 @@ impl<'a> From<Cow<'a, str>> for String { /// ``` /// # use std::borrow::Cow; /// // If the string is not owned... - /// let cow: Cow<str> = Cow::Borrowed("eggplant"); + /// let cow: Cow<'_, str> = Cow::Borrowed("eggplant"); /// // It will allocate on the heap and copy the string. /// let owned: String = String::from(cow); /// assert_eq!(&owned[..], "eggplant"); diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 5bfe537bc83..52a8545413a 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -2768,7 +2768,7 @@ where /// ```rust /// # use std::sync::Arc; /// # use std::borrow::Cow; - /// let cow: Cow<str> = Cow::Borrowed("eggplant"); + /// let cow: Cow<'_, str> = Cow::Borrowed("eggplant"); /// let shared: Arc<str> = Arc::from(cow); /// assert_eq!("eggplant", &shared[..]); /// ``` diff --git a/library/alloc/src/vec/drain.rs b/library/alloc/src/vec/drain.rs index 3091efabd68..f0b63759ac7 100644 --- a/library/alloc/src/vec/drain.rs +++ b/library/alloc/src/vec/drain.rs @@ -16,7 +16,7 @@ use super::Vec; /// /// ``` /// let mut v = vec![0, 1, 2]; -/// let iter: std::vec::Drain<_> = v.drain(..); +/// let iter: std::vec::Drain<'_, _> = v.drain(..); /// ``` #[stable(feature = "drain", since = "1.6.0")] pub struct Drain< diff --git a/library/alloc/src/vec/drain_filter.rs b/library/alloc/src/vec/drain_filter.rs index 650f9213890..21b09023462 100644 --- a/library/alloc/src/vec/drain_filter.rs +++ b/library/alloc/src/vec/drain_filter.rs @@ -16,7 +16,7 @@ use super::Vec; /// #![feature(drain_filter)] /// /// let mut v = vec![0, 1, 2]; -/// let iter: std::vec::DrainFilter<_, _> = v.drain_filter(|x| *x % 2 == 0); +/// let iter: std::vec::DrainFilter<'_, _, _> = v.drain_filter(|x| *x % 2 == 0); /// ``` #[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")] #[derive(Debug)] diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 765c095e37b..97da6f06b70 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -3142,8 +3142,8 @@ where /// /// ``` /// # use std::borrow::Cow; - /// let o: Cow<[i32]> = Cow::Owned(vec![1, 2, 3]); - /// let b: Cow<[i32]> = Cow::Borrowed(&[1, 2, 3]); + /// let o: Cow<'_, [i32]> = Cow::Owned(vec![1, 2, 3]); + /// let b: Cow<'_, [i32]> = Cow::Borrowed(&[1, 2, 3]); /// assert_eq!(Vec::from(o), Vec::from(b)); /// ``` fn from(s: Cow<'a, [T]>) -> Vec<T> { diff --git a/library/alloc/src/vec/splice.rs b/library/alloc/src/vec/splice.rs index 1861147fe72..852fdcc3f5c 100644 --- a/library/alloc/src/vec/splice.rs +++ b/library/alloc/src/vec/splice.rs @@ -14,7 +14,7 @@ use super::{Drain, Vec}; /// ``` /// let mut v = vec![0, 1, 2]; /// let new = [7, 8]; -/// let iter: std::vec::Splice<_> = v.splice(1.., new); +/// let iter: std::vec::Splice<'_, _> = v.splice(1.., new); /// ``` #[derive(Debug)] #[stable(feature = "vec_splice", since = "1.21.0")] | 
