[doc]:fix error code example
This commit is contained in:
parent
196ff446d2
commit
a370ed7644
@ -1337,7 +1337,7 @@ impl<T> SizedTypeProperties for T {}
|
|||||||
/// type B = Wrapper<u8, i8>;
|
/// type B = Wrapper<u8, i8>;
|
||||||
///
|
///
|
||||||
/// // Not necessarily identical even though `u8` and `i8` have the same layout!
|
/// // Not necessarily identical even though `u8` and `i8` have the same layout!
|
||||||
/// // assert!(mem::offset_of!(A, 1), mem::offset_of!(B, 1));
|
/// // assert_eq!(mem::offset_of!(A, 1), mem::offset_of!(B, 1));
|
||||||
///
|
///
|
||||||
/// #[repr(transparent)]
|
/// #[repr(transparent)]
|
||||||
/// struct U8(u8);
|
/// struct U8(u8);
|
||||||
@ -1345,12 +1345,12 @@ impl<T> SizedTypeProperties for T {}
|
|||||||
/// type C = Wrapper<u8, U8>;
|
/// type C = Wrapper<u8, U8>;
|
||||||
///
|
///
|
||||||
/// // Not necessarily identical even though `u8` and `U8` have the same layout!
|
/// // Not necessarily identical even though `u8` and `U8` have the same layout!
|
||||||
/// // assert!(mem::offset_of!(A, 1), mem::offset_of!(C, 1));
|
/// // assert_eq!(mem::offset_of!(A, 1), mem::offset_of!(C, 1));
|
||||||
///
|
///
|
||||||
/// struct Empty<T>(core::marker::PhantomData<T>);
|
/// struct Empty<T>(core::marker::PhantomData<T>);
|
||||||
///
|
///
|
||||||
/// // Not necessarily identical even though `PhantomData` always has the same layout!
|
/// // Not necessarily identical even though `PhantomData` always has the same layout!
|
||||||
/// // assert!(mem::offset_of!(Empty<u8>, 0), mem::offset_of!(Empty<i8>, 0));
|
/// // assert_eq!(mem::offset_of!(Empty<u8>, 0), mem::offset_of!(Empty<i8>, 0));
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [explicit `repr` attribute]: https://doc.rust-lang.org/reference/type-layout.html#representations
|
/// [explicit `repr` attribute]: https://doc.rust-lang.org/reference/type-layout.html#representations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user