Skip to content

Commit 54527db

Browse files
authored
ptr::{read,write}_unaligned: use no_run and reword slightly.
1 parent bee964c commit 54527db

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/ptr/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ pub unsafe fn read<T>(src: *const T) -> T {
662662
///
663663
/// An example of what not to do and how this relates to `read_unaligned` is:
664664
///
665-
/// ```
665+
/// ```no_run
666666
/// #[repr(packed, C)]
667667
/// struct Packed {
668668
/// _padding: u8,
@@ -689,7 +689,7 @@ pub unsafe fn read<T>(src: *const T) -> T {
689689
/// };
690690
/// ```
691691
///
692-
/// Accessing unaligned values directly with e.g. `packed.unaligned` is safe however.
692+
/// Accessing unaligned fields directly with e.g. `packed.unaligned` is safe however.
693693
// FIXME: Update docs based on outcome of RFC #2582 and friends.
694694
#[inline]
695695
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
@@ -834,7 +834,7 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
834834
///
835835
/// An example of what not to do and how this relates to `write_unaligned` is:
836836
///
837-
/// ```
837+
/// ```no_run
838838
/// #[repr(packed, C)]
839839
/// struct Packed {
840840
/// _padding: u8,
@@ -859,7 +859,7 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
859859
/// };
860860
/// ```
861861
///
862-
/// Accessing unaligned values directly with e.g. `packed.unaligned` is safe however.
862+
/// Accessing unaligned fields directly with e.g. `packed.unaligned` is safe however.
863863
// FIXME: Update docs based on outcome of RFC #2582 and friends.
864864
#[inline]
865865
#[stable(feature = "ptr_unaligned", since = "1.17.0")]

0 commit comments

Comments
 (0)