Skip to content

Commit 50c615b

Browse files
committed
warn(missing_docs) in liballoc, and add missing docs
1 parent 8ef7ca1 commit 50c615b

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

src/liballoc/borrow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ impl<'a, B: ?Sized> Borrow<B> for Cow<'a, B>
3232
/// from any borrow of a given type.
3333
#[stable(feature = "rust1", since = "1.0.0")]
3434
pub trait ToOwned {
35+
/// The resulting type after obtaining ownership.
3536
#[stable(feature = "rust1", since = "1.0.0")]
3637
type Owned: Borrow<Self>;
3738

src/liballoc/boxed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ impl<A, F: Fn<A> + ?Sized> Fn<A> for Box<F> {
760760
#[unstable(feature = "fnbox",
761761
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
762762
pub trait FnBox<A>: FnOnce<A> {
763+
/// Performs the call operation.
763764
fn call_box(self: Box<Self>, args: A) -> Self::Output;
764765
}
765766

src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#![needs_allocator]
6060

6161
#![warn(deprecated_in_future)]
62+
#![warn(missing_docs)]
6263
#![warn(missing_debug_implementations)]
6364
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
6465

src/liballoc/slice.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,16 @@ pub trait SliceConcatExt<T: ?Sized> {
570570
#[stable(feature = "rename_connect_to_join", since = "1.3.0")]
571571
fn join(&self, sep: &T) -> Self::Output;
572572

573+
/// Flattens a slice of `T` into a single value `Self::Output`, placing a
574+
/// given separator between each.
575+
///
576+
/// # Examples
577+
///
578+
/// ```
579+
/// # #![allow(deprecated)]
580+
/// assert_eq!(["hello", "world"].connect(" "), "hello world");
581+
/// assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
582+
/// ```
573583
#[stable(feature = "rust1", since = "1.0.0")]
574584
#[rustc_deprecated(since = "1.3.0", reason = "renamed to join")]
575585
fn connect(&self, sep: &T) -> Self::Output;

0 commit comments

Comments
 (0)