rust/tests/ui/array-slice-vec/huge-largest-array.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
278 B
Rust
Raw Normal View History

//@ run-pass
use std::mem::size_of;
2015-01-16 15:01:02 +00:00
#[cfg(target_pointer_width = "32")]
pub fn main() {
assert_eq!(size_of::<[u8; (1 << 31) - 1]>(), (1 << 31) - 1);
}
2015-01-16 15:01:02 +00:00
#[cfg(target_pointer_width = "64")]
pub fn main() {
assert_eq!(size_of::<[u8; (1 << 47) - 1]>(), (1 << 47) - 1);
}