]> git.lizzy.rs Git - rust.git/commitdiff
warn(missing_docs) in liballoc, and add missing docs
authorRalf Jung <post@ralfj.de>
Mon, 15 Apr 2019 14:34:08 +0000 (16:34 +0200)
committerRalf Jung <post@ralfj.de>
Mon, 15 Apr 2019 14:35:50 +0000 (16:35 +0200)
src/liballoc/borrow.rs
src/liballoc/boxed.rs
src/liballoc/lib.rs
src/liballoc/slice.rs

index ee1799fad8e15c4ae09b31623b5ebb8670a82d13..d5e15b3719c2e6cb89cb377c7515730ff8e80698 100644 (file)
@@ -32,6 +32,7 @@ fn borrow(&self) -> &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>;
 
index 6a6a9146e2432b47327d735fde002fe27ba28d8b..8a3950718d7d26d8cb85e2ca065fb4924f9c1d2a 100644 (file)
@@ -760,6 +760,7 @@ extern "rust-call" fn call(&self, args: A) -> Self::Output {
 #[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;
 }
 
index d8d61c673af38f5dcb934d7679fa7f2912ba039d..63b3fbbdaefe1fcbd4676407a46829e076de55a1 100644 (file)
@@ -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
 
index f4b2d463778a99dede8d43748159c11d12df656a..6eac848740106b63c17d7f43dd2f9349c9e71d0c 100644 (file)
@@ -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;