diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-14 16:42:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-14 16:42:22 +0200 |
| commit | afc52916f658e7b5dc102ef7cd5b2784cd15c4e3 (patch) | |
| tree | 2cc0ee0da68aa5d26053b787ee42b11671fa490c /src/libcore | |
| parent | 45baedb14b94ee26c70439e244b73ab3090a4d13 (diff) | |
| parent | 58a26c8fc0200c29bd753cf6fcfd80ee34a98920 (diff) | |
| download | rust-afc52916f658e7b5dc102ef7cd5b2784cd15c4e3.tar.gz rust-afc52916f658e7b5dc102ef7cd5b2784cd15c4e3.zip | |
Rollup merge of #64203 - alexreg:rush-pr-2, r=centril
A few cosmetic improvements to code & comments in liballoc and libcore Factored out from hacking on rustc for work on the REPL. r? @Centril
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/any.rs | 6 | ||||
| -rw-r--r-- | src/libcore/marker.rs | 4 | ||||
| -rw-r--r-- | src/libcore/ptr/mod.rs | 4 | ||||
| -rw-r--r-- | src/libcore/ptr/non_null.rs | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs index e8a0a88f12a..0afbf4f1346 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -153,13 +153,13 @@ impl dyn Any { #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn is<T: Any>(&self) -> bool { - // Get TypeId of the type this function is instantiated with + // Get `TypeId` of the type this function is instantiated with. let t = TypeId::of::<T>(); - // Get TypeId of the type in the trait object + // Get `TypeId` of the type in the trait object. let concrete = self.type_id(); - // Compare both TypeIds on equality + // Compare both `TypeId`s on equality. t == concrete } diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 89af2528c05..347e7dce6e6 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -602,10 +602,10 @@ unsafe impl<T: ?Sized> Freeze for *mut T {} unsafe impl<T: ?Sized> Freeze for &T {} unsafe impl<T: ?Sized> Freeze for &mut T {} -/// Types which can be safely moved after being pinned. +/// Types that can be safely moved after being pinned. /// /// Since Rust itself has no notion of immovable types, and considers moves -/// (e.g. through assignment or [`mem::replace`]) to always be safe, +/// (e.g., through assignment or [`mem::replace`]) to always be safe, /// this trait cannot prevent types from moving by itself. /// /// Instead it is used to prevent moves through the type system, diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs index f5fbd1a6b13..13ccc9b252a 100644 --- a/src/libcore/ptr/mod.rs +++ b/src/libcore/ptr/mod.rs @@ -1042,7 +1042,7 @@ impl<T: ?Sized> *const T { (self as *const u8) == null() } - /// Cast to a pointer to a different type + /// Casts to a pointer of another type. #[stable(feature = "ptr_cast", since = "1.38.0")] #[inline] pub const fn cast<U>(self) -> *const U { @@ -1726,7 +1726,7 @@ impl<T: ?Sized> *mut T { (self as *mut u8) == null_mut() } - /// Cast to a pointer to a different type + /// Casts to a pointer of another type. #[stable(feature = "ptr_cast", since = "1.38.0")] #[inline] pub const fn cast<U>(self) -> *mut U { diff --git a/src/libcore/ptr/non_null.rs b/src/libcore/ptr/non_null.rs index ad3d1ce396a..7dcd57f1f98 100644 --- a/src/libcore/ptr/non_null.rs +++ b/src/libcore/ptr/non_null.rs @@ -125,7 +125,7 @@ impl<T: ?Sized> NonNull<T> { &mut *self.as_ptr() } - /// Cast to a pointer of another type + /// Casts to a pointer of another type. #[stable(feature = "nonnull_cast", since = "1.27.0")] #[inline] pub const fn cast<U>(self) -> NonNull<U> { |
