This commit is contained in:
Oli Scherer 2022-07-11 14:35:04 +00:00
parent cdd6bba8f6
commit 0318b70514

View File

@ -30,7 +30,10 @@ macro_rules! assert_size_eq {
($ty:ty, $size:expr, $optioned_size:expr) => { ($ty:ty, $size:expr, $optioned_size:expr) => {
assert_size_eq!($ty, $size); assert_size_eq!($ty, $size);
assert_size_eq!(Option<$ty>, $optioned_size); assert_size_eq!(Option<$ty>, $optioned_size);
const _: () = assert!($size == $optioned_size || size_of::<$ty>() < size_of::<Option<$ty>>()); const _: () = assert!(
$size == $optioned_size ||
size_of::<$ty>() < size_of::<Option<$ty>>()
);
}; };
} }