diff options
| -rw-r--r-- | src/test/ui/layout/unsafe-cell-hides-niche.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/ui/layout/unsafe-cell-hides-niche.rs b/src/test/ui/layout/unsafe-cell-hides-niche.rs index 7fb55d8219e..21ff0cb1e55 100644 --- a/src/test/ui/layout/unsafe-cell-hides-niche.rs +++ b/src/test/ui/layout/unsafe-cell-hides-niche.rs @@ -18,10 +18,12 @@ struct Transparent<T>(T); struct NoNiche<T>(UnsafeCell<T>); +struct Size<const S: usize>; + // Overwriting the runtime assertion and making it a compile-time assertion macro_rules! assert_size { ($a:ty, $b:literal) => {{ - const _: () = assert!(std::mem::size_of::<$a>() == $b); + const _: Size::<$b> = Size::<{std::mem::size_of::<$a>()}>; }}; } |
