6 // The limit for "too big for the current architecture" is dependent on the target pointer size
7 // however it's artifically limited on 64 bits
8 // logic copied from rustc_target::abi::TargetDataLayout::obj_size_bound()
9 const fn max_size() -> usize {
10 #[cfg(target_pointer_width = "16")]
15 #[cfg(target_pointer_width = "32")]
20 #[cfg(target_pointer_width = "64")]
26 target_pointer_width = "16",
27 target_pointer_width = "32",
28 target_pointer_width = "64"
37 static BAR: [u8; max_size() - 1];
38 static BAZ: [u8; max_size()]; //~ ERROR extern static is too large
39 static UWU: [usize; usize::MAX]; //~ ERROR extern static is too large
40 static A: ReallyBig; //~ ERROR extern static is too large