about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorBaoshan <pangbw@gmail.com>2019-09-01 17:52:09 -0700
committerGitHub <noreply@github.com>2019-09-01 17:52:09 -0700
commitd5ef9df032ec32c48d6c59050735352c48ff16f8 (patch)
tree31a87971a84ffc967645099773910d6498d0cb0b /src/liballoc
parent7726b54c059db0759e9725a58e222118eacec6d9 (diff)
parentdfd43f0fdd4e6969c7d82c0670d70bf305fbccf8 (diff)
downloadrust-d5ef9df032ec32c48d6c59050735352c48ff16f8.tar.gz
rust-d5ef9df032ec32c48d6c59050735352c48ff16f8.zip
Merge pull request #13 from rust-lang/master
sync with rust-lang/rust
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/collections/linked_list.rs2
-rw-r--r--src/liballoc/collections/vec_deque.rs4
-rw-r--r--src/liballoc/vec.rs1
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,