From ba0328327c8ce94f7bf380223d655c70de584e93 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sat, 17 Aug 2019 15:15:17 +0200 Subject: [PATCH] Doc nits Co-Authored-By: Ralf Jung --- src/liballoc/boxed.rs | 8 ++++---- src/liballoc/rc.rs | 10 +++++----- src/liballoc/sync.rs | 10 +++++----- src/libcore/ptr/unique.rs | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index e315b9f3417..c61e3183409 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -123,7 +123,7 @@ pub fn new(x: T) -> Box { box x } - /// Construct a new box with uninitialized contents. + /// Constructs a new box with uninitialized contents. /// /// # Examples /// @@ -161,7 +161,7 @@ pub fn pin(x: T) -> Pin> { } impl Box<[T]> { - /// Construct a new boxed slice with uninitialized contents. + /// Constructs a new boxed slice with uninitialized contents. /// /// # Examples /// @@ -192,7 +192,7 @@ pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit]> { } impl Box> { - /// Convert to `Box`. + /// Converts to `Box`. /// /// # Safety /// @@ -228,7 +228,7 @@ pub unsafe fn assume_init(self) -> Box { } impl Box<[mem::MaybeUninit]> { - /// Convert to `Box<[T]>`. + /// Converts to `Box<[T]>`. /// /// # Safety /// diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 1509afa4889..7183336ba53 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -327,7 +327,7 @@ pub fn new(value: T) -> Rc { })) } - /// Construct a new Rc with uninitialized contents. + /// Constructs a new `Rc` with uninitialized contents. /// /// # Examples /// @@ -409,7 +409,7 @@ pub fn try_unwrap(this: Self) -> Result { } impl Rc<[T]> { - /// Construct a new reference-counted slice with uninitialized contents. + /// Constructs a new reference-counted slice with uninitialized contents. /// /// # Examples /// @@ -441,7 +441,7 @@ pub fn new_uninit_slice(len: usize) -> Rc<[mem::MaybeUninit]> { } impl Rc> { - /// Convert to `Rc`. + /// Converts to `Rc`. /// /// # Safety /// @@ -480,7 +480,7 @@ pub unsafe fn assume_init(self) -> Rc { } impl Rc<[mem::MaybeUninit]> { - /// Convert to `Rc<[T]>`. + /// Converts to `Rc<[T]>`. /// /// # Safety /// @@ -721,7 +721,7 @@ pub fn get_mut(this: &mut Self) -> Option<&mut T> { /// /// Any other `Rc` or [`Weak`] pointers to the same value must not be dereferenced /// for the duration of the returned borrow. - /// This is trivially the case if no such pointer exist, + /// This is trivially the case if no such pointers exist, /// for example immediately after `Rc::new`. /// /// # Examples diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 078ddc27da9..ffab842c769 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -311,7 +311,7 @@ pub fn new(data: T) -> Arc { Self::from_inner(Box::into_raw_non_null(x)) } - /// Construct a Arc box with uninitialized contents. + /// Constructs a new `Arc` with uninitialized contents. /// /// # Examples /// @@ -393,7 +393,7 @@ pub fn try_unwrap(this: Self) -> Result { } impl Arc<[T]> { - /// Construct a new reference-counted slice with uninitialized contents. + /// Constructs a new reference-counted slice with uninitialized contents. /// /// # Examples /// @@ -425,7 +425,7 @@ pub fn new_uninit_slice(len: usize) -> Arc<[mem::MaybeUninit]> { } impl Arc> { - /// Convert to `Arc`. + /// Converts to `Arc`. /// /// # Safety /// @@ -464,7 +464,7 @@ pub unsafe fn assume_init(self) -> Arc { } impl Arc<[mem::MaybeUninit]> { - /// Convert to `Arc<[T]>`. + /// Converts to `Arc<[T]>`. /// /// # Safety /// @@ -1106,7 +1106,7 @@ pub fn get_mut(this: &mut Self) -> Option<&mut T> { /// /// Any other `Arc` or [`Weak`] pointers to the same value must not be dereferenced /// for the duration of the returned borrow. - /// This is trivially the case if no such pointer exist, + /// This is trivially the case if no such pointers exist, /// for example immediately after `Arc::new`. /// /// # Examples diff --git a/src/libcore/ptr/unique.rs b/src/libcore/ptr/unique.rs index a739f3b6022..24f45394a3b 100644 --- a/src/libcore/ptr/unique.rs +++ b/src/libcore/ptr/unique.rs @@ -123,7 +123,7 @@ pub unsafe fn as_mut(&mut self) -> &mut T { &mut *self.as_ptr() } - /// Cast to a pointer of another type + /// Casts to a pointer of another type #[inline] pub const fn cast(self) -> Unique { unsafe { -- GitLab