]> git.lizzy.rs Git - rust.git/commitdiff
ptr::{read,write}_unaligned: use no_run and reword slightly.
authorMazdak Farrokhzad <twingoow@gmail.com>
Thu, 4 Jul 2019 07:54:37 +0000 (09:54 +0200)
committerGitHub <noreply@github.com>
Thu, 4 Jul 2019 07:54:37 +0000 (09:54 +0200)
src/libcore/ptr/mod.rs

index 7a33174d59ffc970e1e8f6d56baba7c5574b8704..acb9e52b255b4219e0f095794b09a5b6e0c9c98f 100644 (file)
@@ -662,7 +662,7 @@ pub unsafe fn read<T>(src: *const T) -> T {
 ///
 /// An example of what not to do and how this relates to `read_unaligned` is:
 ///
-/// ```
+/// ```no_run
 /// #[repr(packed, C)]
 /// struct Packed {
 ///     _padding: u8,
@@ -689,7 +689,7 @@ pub unsafe fn read<T>(src: *const T) -> T {
 /// };
 /// ```
 ///
-/// Accessing unaligned values directly with e.g. `packed.unaligned` is safe however.
+/// Accessing unaligned fields directly with e.g. `packed.unaligned` is safe however.
 // FIXME: Update docs based on outcome of RFC #2582 and friends.
 #[inline]
 #[stable(feature = "ptr_unaligned", since = "1.17.0")]
@@ -834,7 +834,7 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
 ///
 /// An example of what not to do and how this relates to `write_unaligned` is:
 ///
-/// ```
+/// ```no_run
 /// #[repr(packed, C)]
 /// struct Packed {
 ///     _padding: u8,
@@ -859,7 +859,7 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
 /// };
 /// ```
 ///
-/// Accessing unaligned values directly with e.g. `packed.unaligned` is safe however.
+/// Accessing unaligned fields directly with e.g. `packed.unaligned` is safe however.
 // FIXME: Update docs based on outcome of RFC #2582 and friends.
 #[inline]
 #[stable(feature = "ptr_unaligned", since = "1.17.0")]