Skip to content

Commit

Permalink
Unrolled build for rust-lang#122720
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#122720 - heisen-li:offset_of, r=workingjubilee

[doc]:fix error code example

fixs rust-lang#122716
  • Loading branch information
rust-timer authored Mar 19, 2024
2 parents a385e56 + a370ed7 commit 0701c9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,20 +1337,20 @@ impl<T> SizedTypeProperties for T {}
/// type B = Wrapper<u8, i8>;
///
/// // 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)]
/// struct U8(u8);
///
/// type C = Wrapper<u8, U8>;
///
/// // 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>);
///
/// // 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
Expand Down

0 comments on commit 0701c9b

Please sign in to comment.