diff options
| author | Baoshan <pangbw@gmail.com> | 2019-09-03 16:33:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-03 16:33:18 -0700 |
| commit | e316ba3b60433bd703575a00d7fd5e344e29912d (patch) | |
| tree | 4d74702faa98a70d127b17f19f908dc3875e8faa /src/liballoc | |
| parent | 964c37cdecbd1aa0e7870afac9ba38e5168be65f (diff) | |
| parent | b9de4ef89e0e53099a084001b26ec3207c5f8391 (diff) | |
| download | rust-e316ba3b60433bd703575a00d7fd5e344e29912d.tar.gz rust-e316ba3b60433bd703575a00d7fd5e344e29912d.zip | |
Merge pull request #12 from rust-lang/master
sync with rust-lang/rust branch master
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/collections/linked_list.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/collections/vec_deque.rs | 4 | ||||
| -rw-r--r-- | src/liballoc/vec.rs | 1 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs index a14a3fe9994..816a71f2557 100644 --- a/src/liballoc/collections/linked_list.rs +++ b/src/liballoc/collections/linked_list.rs @@ -276,7 +276,7 @@ impl<T> LinkedList<T> { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - pub fn new() -> Self { + pub const fn new() -> Self { LinkedList { head: None, tail: None, diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs index 7315963cc8b..a4a0fbb194d 100644 --- a/src/liballoc/collections/vec_deque.rs +++ b/src/liballoc/collections/vec_deque.rs @@ -1810,7 +1810,7 @@ impl<T> VecDeque<T> { other } - /// Moves all the elements of `other` into `Self`, leaving `other` empty. + /// Moves all the elements of `other` into `self`, leaving `other` empty. /// /// # Panics /// @@ -1847,7 +1847,7 @@ impl<T> VecDeque<T> { /// /// let mut buf = VecDeque::new(); /// buf.extend(1..5); - /// buf.retain(|&x| x%2 == 0); + /// buf.retain(|&x| x % 2 == 0); /// assert_eq!(buf, [2, 4]); /// ``` /// diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index d2798955c46..d5dc2d4b868 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -291,6 +291,7 @@ use crate::raw_vec::RawVec; /// [`reserve`]: ../../std/vec/struct.Vec.html#method.reserve /// [owned slice]: ../../std/boxed/struct.Box.html #[stable(feature = "rust1", since = "1.0.0")] +#[cfg_attr(all(not(bootstrap), not(test)), rustc_diagnostic_item = "vec_type")] pub struct Vec<T> { buf: RawVec<T>, len: usize, |
