Skip to content

Commit dc510b7

Browse files
committed
Merge from rustc
2 parents 1155f18 + 70cef76 commit dc510b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+7442
-3259
lines changed

alloc/src/borrow.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ where
115115
/// ```
116116
/// use std::borrow::Cow;
117117
///
118-
/// fn abs_all(input: &mut Cow<[i32]>) {
118+
/// fn abs_all(input: &mut Cow<'_, [i32]>) {
119119
/// for i in 0..input.len() {
120120
/// let v = input[i];
121121
/// if v < 0 {
@@ -145,7 +145,7 @@ where
145145
/// ```
146146
/// use std::borrow::Cow;
147147
///
148-
/// struct Items<'a, X: 'a> where [X]: ToOwned<Owned = Vec<X>> {
148+
/// struct Items<'a, X> where [X]: ToOwned<Owned = Vec<X>> {
149149
/// values: Cow<'a, [X]>,
150150
/// }
151151
///
@@ -267,7 +267,7 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> {
267267
///
268268
/// assert_eq!(
269269
/// cow,
270-
/// Cow::Owned(String::from("FOO")) as Cow<str>
270+
/// Cow::Owned(String::from("FOO")) as Cow<'_, str>
271271
/// );
272272
/// ```
273273
#[stable(feature = "rust1", since = "1.0.0")]
@@ -311,7 +311,7 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> {
311311
/// use std::borrow::Cow;
312312
///
313313
/// let s = "Hello world!";
314-
/// let cow: Cow<str> = Cow::Owned(String::from(s));
314+
/// let cow: Cow<'_, str> = Cow::Owned(String::from(s));
315315
///
316316
/// assert_eq!(
317317
/// cow.into_owned(),

alloc/src/fmt.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
//! # use std::fmt;
364364
//! # struct Foo; // our custom type
365365
//! # impl fmt::Display for Foo {
366-
//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
366+
//! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
367367
//! # write!(f, "testing, testing")
368368
//! # } }
369369
//! ```
@@ -399,7 +399,7 @@
399399
//! }
400400
//!
401401
//! impl fmt::Display for Vector2D {
402-
//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
402+
//! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
403403
//! // The `f` value implements the `Write` trait, which is what the
404404
//! // write! macro is expecting. Note that this formatting ignores the
405405
//! // various flags provided to format strings.
@@ -410,7 +410,7 @@
410410
//! // Different traits allow different forms of output of a type. The meaning
411411
//! // of this format is to print the magnitude of a vector.
412412
//! impl fmt::Binary for Vector2D {
413-
//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
413+
//! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
414414
//! let magnitude = (self.x * self.x + self.y * self.y) as f64;
415415
//! let magnitude = magnitude.sqrt();
416416
//!
@@ -517,7 +517,7 @@
517517
//! let mut some_writer = io::stdout();
518518
//! write!(&mut some_writer, "{}", format_args!("print with a {}", "macro"));
519519
//!
520-
//! fn my_fmt_fn(args: fmt::Arguments) {
520+
//! fn my_fmt_fn(args: fmt::Arguments<'_>) {
521521
//! write!(&mut io::stdout(), "{args}");
522522
//! }
523523
//! my_fmt_fn(format_args!(", or a {} too", "function"));

alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
#![feature(const_maybe_uninit_write)]
114114
#![feature(const_maybe_uninit_zeroed)]
115115
#![feature(const_pin)]
116-
#![feature(const_ptr_read)]
117116
#![feature(const_refs_to_cell)]
118117
#![feature(const_size_of_val)]
119118
#![feature(const_waker)]

alloc/src/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ where
20392039
/// ```rust
20402040
/// # use std::rc::Rc;
20412041
/// # use std::borrow::Cow;
2042-
/// let cow: Cow<str> = Cow::Borrowed("eggplant");
2042+
/// let cow: Cow<'_, str> = Cow::Borrowed("eggplant");
20432043
/// let shared: Rc<str> = Rc::from(cow);
20442044
/// assert_eq!("eggplant", &shared[..]);
20452045
/// ```

alloc/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2741,7 +2741,7 @@ impl<'a> From<Cow<'a, str>> for String {
27412741
/// ```
27422742
/// # use std::borrow::Cow;
27432743
/// // If the string is not owned...
2744-
/// let cow: Cow<str> = Cow::Borrowed("eggplant");
2744+
/// let cow: Cow<'_, str> = Cow::Borrowed("eggplant");
27452745
/// // It will allocate on the heap and copy the string.
27462746
/// let owned: String = String::from(cow);
27472747
/// assert_eq!(&owned[..], "eggplant");

alloc/src/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2768,7 +2768,7 @@ where
27682768
/// ```rust
27692769
/// # use std::sync::Arc;
27702770
/// # use std::borrow::Cow;
2771-
/// let cow: Cow<str> = Cow::Borrowed("eggplant");
2771+
/// let cow: Cow<'_, str> = Cow::Borrowed("eggplant");
27722772
/// let shared: Arc<str> = Arc::from(cow);
27732773
/// assert_eq!("eggplant", &shared[..]);
27742774
/// ```

alloc/src/vec/drain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use super::Vec;
1616
///
1717
/// ```
1818
/// let mut v = vec![0, 1, 2];
19-
/// let iter: std::vec::Drain<_> = v.drain(..);
19+
/// let iter: std::vec::Drain<'_, _> = v.drain(..);
2020
/// ```
2121
#[stable(feature = "drain", since = "1.6.0")]
2222
pub struct Drain<

alloc/src/vec/drain_filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use super::Vec;
1616
/// #![feature(drain_filter)]
1717
///
1818
/// let mut v = vec![0, 1, 2];
19-
/// let iter: std::vec::DrainFilter<_, _> = v.drain_filter(|x| *x % 2 == 0);
19+
/// let iter: std::vec::DrainFilter<'_, _, _> = v.drain_filter(|x| *x % 2 == 0);
2020
/// ```
2121
#[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")]
2222
#[derive(Debug)]

alloc/src/vec/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3142,8 +3142,8 @@ where
31423142
///
31433143
/// ```
31443144
/// # use std::borrow::Cow;
3145-
/// let o: Cow<[i32]> = Cow::Owned(vec![1, 2, 3]);
3146-
/// let b: Cow<[i32]> = Cow::Borrowed(&[1, 2, 3]);
3145+
/// let o: Cow<'_, [i32]> = Cow::Owned(vec![1, 2, 3]);
3146+
/// let b: Cow<'_, [i32]> = Cow::Borrowed(&[1, 2, 3]);
31473147
/// assert_eq!(Vec::from(o), Vec::from(b));
31483148
/// ```
31493149
fn from(s: Cow<'a, [T]>) -> Vec<T> {

alloc/src/vec/splice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use super::{Drain, Vec};
1414
/// ```
1515
/// let mut v = vec![0, 1, 2];
1616
/// let new = [7, 8];
17-
/// let iter: std::vec::Splice<_> = v.splice(1.., new);
17+
/// let iter: std::vec::Splice<'_, _> = v.splice(1.., new);
1818
/// ```
1919
#[derive(Debug)]
2020
#[stable(feature = "vec_splice", since = "1.21.0")]

0 commit comments

Comments
 (0)