Skip to content

Commit

Permalink
Fix some doc-comment examples for earlier API refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jan 20, 2018
1 parent 12b3630 commit 943a9e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libcore/ptr.rs
Expand Up @@ -2403,7 +2403,7 @@ impl<T: ?Sized> Unique<T> {
///
/// The resulting lifetime is bound to self so this behaves "as if"
/// it were actually an instance of T that is getting borrowed. If a longer
/// (unbound) lifetime is needed, use `&*my_ptr.ptr()`.
/// (unbound) lifetime is needed, use `&*my_ptr.as_ptr()`.
pub unsafe fn as_ref(&self) -> &T {
&*self.as_ptr()
}
Expand All @@ -2412,7 +2412,7 @@ impl<T: ?Sized> Unique<T> {
///
/// The resulting lifetime is bound to self so this behaves "as if"
/// it were actually an instance of T that is getting borrowed. If a longer
/// (unbound) lifetime is needed, use `&mut *my_ptr.ptr()`.
/// (unbound) lifetime is needed, use `&mut *my_ptr.as_ptr()`.
pub unsafe fn as_mut(&mut self) -> &mut T {
&mut *self.as_ptr()
}
Expand Down Expand Up @@ -2544,7 +2544,7 @@ impl<T: ?Sized> NonNull<T> {
///
/// The resulting lifetime is bound to self so this behaves "as if"
/// it were actually an instance of T that is getting borrowed. If a longer
/// (unbound) lifetime is needed, use `&*my_ptr.ptr()`.
/// (unbound) lifetime is needed, use `&*my_ptr.as_ptr()`.
#[stable(feature = "nonnull", since = "1.24.0")]
pub unsafe fn as_ref(&self) -> &T {
&*self.as_ptr()
Expand All @@ -2554,7 +2554,7 @@ impl<T: ?Sized> NonNull<T> {
///
/// The resulting lifetime is bound to self so this behaves "as if"
/// it were actually an instance of T that is getting borrowed. If a longer
/// (unbound) lifetime is needed, use `&mut *my_ptr.ptr_mut()`.
/// (unbound) lifetime is needed, use `&mut *my_ptr.as_ptr()`.
#[stable(feature = "nonnull", since = "1.24.0")]
pub unsafe fn as_mut(&mut self) -> &mut T {
&mut *self.as_ptr()
Expand Down

0 comments on commit 943a9e7

Please sign in to comment.