Closed
Description
time::Instant
on Linux is 16 bytes, while it is 8 bytes on MacOs. This makes it hard to assert the size of any structs using it.
use std::mem;
use std::time::Instant;
fn assert_size<T>(want: usize) {
assert_eq!(mem::size_of::<T>(), want);
}
fn main() {
// This is 16 on Linux, but 8 on MacOS (and Windows?).
assert_size::<Instant>(16);
// This is 24 on Linux, but 16 on MacOS (and Windows?).
assert_size::<Option<Instant>>(24);
}