diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index e247b9ed83df5..d1dc6720271f3 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1337,7 +1337,7 @@ impl SizedTypeProperties for T {} /// type B = Wrapper; /// /// // 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); @@ -1345,12 +1345,12 @@ impl SizedTypeProperties for T {} /// type C = Wrapper; /// /// // 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(core::marker::PhantomData); /// /// // Not necessarily identical even though `PhantomData` always has the same layout! -/// // assert!(mem::offset_of!(Empty, 0), mem::offset_of!(Empty, 0)); +/// // assert_eq!(mem::offset_of!(Empty, 0), mem::offset_of!(Empty, 0)); /// ``` /// /// [explicit `repr` attribute]: https://doc.rust-lang.org/reference/type-layout.html#representations