about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-04-15 16:34:08 +0200
committerRalf Jung <post@ralfj.de>2019-04-15 16:35:50 +0200
commit50c615baa2c09694f0ba446c53777e98db88ed01 (patch)
tree39d0229f03a7976e170c8015b5507eb5a55fbfac /src/liballoc
parent8ef7ca130271369400719c712369c33a30d6528b (diff)
downloadrust-50c615baa2c09694f0ba446c53777e98db88ed01.tar.gz
rust-50c615baa2c09694f0ba446c53777e98db88ed01.zip
warn(missing_docs) in liballoc, and add missing docs
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/borrow.rs1
-rw-r--r--src/liballoc/boxed.rs1
-rw-r--r--src/liballoc/lib.rs1
-rw-r--r--src/liballoc/slice.rs10
4 files changed, 13 insertions, 0 deletions
diff --git a/src/liballoc/borrow.rs b/src/liballoc/borrow.rs
index ee1799fad8e..d5e15b3719c 100644
--- a/src/liballoc/borrow.rs
+++ b/src/liballoc/borrow.rs
@@ -32,6 +32,7 @@ impl<'a, B: ?Sized> Borrow<B> for Cow<'a, B>
 /// from any borrow of a given type.
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait ToOwned {
+    /// The resulting type after obtaining ownership.
     #[stable(feature = "rust1", since = "1.0.0")]
     type Owned: Borrow<Self>;
 
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 6a6a9146e24..8a3950718d7 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -760,6 +760,7 @@ impl<A, F: Fn<A> + ?Sized> Fn<A> for Box<F> {
 #[unstable(feature = "fnbox",
            reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
 pub trait FnBox<A>: FnOnce<A> {
+    /// Performs the call operation.
     fn call_box(self: Box<Self>, args: A) -> Self::Output;
 }
 
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index d8d61c673af..63b3fbbdaef 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -59,6 +59,7 @@
 #![needs_allocator]
 
 #![warn(deprecated_in_future)]
+#![warn(missing_docs)]
 #![warn(missing_debug_implementations)]
 #![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
 
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs
index f4b2d463778..6eac8487401 100644
--- a/src/liballoc/slice.rs
+++ b/src/liballoc/slice.rs
@@ -570,6 +570,16 @@ pub trait SliceConcatExt<T: ?Sized> {
     #[stable(feature = "rename_connect_to_join", since = "1.3.0")]
     fn join(&self, sep: &T) -> Self::Output;
 
+    /// Flattens a slice of `T` into a single value `Self::Output`, placing a
+    /// given separator between each.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(deprecated)]
+    /// assert_eq!(["hello", "world"].connect(" "), "hello world");
+    /// assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_deprecated(since = "1.3.0", reason = "renamed to join")]
     fn connect(&self, sep: &T) -> Self::Output;