about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-12-24 21:14:17 +0000
committerbors <bors@rust-lang.org>2016-12-24 21:14:17 +0000
commite60aa62ffe7462d48cb44ab33f2551b466745e83 (patch)
tree97d19ca2d9cedb110340266922ae30aab94347b3 /src/libcollections
parent00e61d41859514c906b8b630ea10ececa4f0c2cd (diff)
parentdf63b0ce720a846e8c7983b1b26ed3e3d36ba972 (diff)
Auto merge of #38594 - steveklabnik:rollup, r=steveklabnik
Rollup of 14 pull requests

- Successful merges: #37956, #38013, #38297, #38480, #38497, #38502, #38505, #38513, #38521, #38549, #38554, #38557, #38568, #38572
- Failed merges:
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/linked_list.rs20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs
index e8c2e0b5902..31085509088 100644
--- a/src/libcollections/linked_list.rs
+++ b/src/libcollections/linked_list.rs
@@ -10,8 +10,15 @@
 
 //! A doubly-linked list with owned nodes.
 //!
-//! The `LinkedList` allows pushing and popping elements at either end and is thus
-//! efficiently usable as a double-ended queue.
+//! The `LinkedList` allows pushing and popping elements at either end
+//! in constant time.
+//!
+//! Almost always it is better to use `Vec` or [`VecDeque`] instead of
+//! [`LinkedList`]. In general, array-based containers are faster,
+//! more memory efficient and make better use of CPU cache.
+//!
+//! [`LinkedList`]: ../linked_list/struct.LinkedList.html
+//! [`VecDeque`]: ../vec_deque/struct.VecDeque.html
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
@@ -27,7 +34,14 @@ use core::ptr::{self, Shared};
 
 use super::SpecExtend;
 
-/// A doubly-linked list.
+/// A doubly-linked list with owned nodes.
+///
+/// The `LinkedList` allows pushing and popping elements at either end
+/// in constant time.
+///
+/// Almost always it is better to use `Vec` or `VecDeque` instead of
+/// `LinkedList`. In general, array-based containers are faster,
+/// more memory efficient and make better use of CPU cache.
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct LinkedList<T> {
     head: Option<Shared<Node<T>>>,