We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fef596f commit 9a20450Copy full SHA for 9a20450
src/test/ui/layout/unsafe-cell-hides-niche.rs
@@ -18,10 +18,12 @@ struct Transparent<T>(T);
18
19
struct NoNiche<T>(UnsafeCell<T>);
20
21
+struct Size<const S: usize>;
22
+
23
// Overwriting the runtime assertion and making it a compile-time assertion
24
macro_rules! assert_size {
25
($a:ty, $b:literal) => {{
- const _: () = assert!(std::mem::size_of::<$a>() == $b);
26
+ const _: Size::<$b> = Size::<{std::mem::size_of::<$a>()}>;
27
}};
28
}
29
0 commit comments