]> git.lizzy.rs Git - rust.git/blob - tests/ui/limits/issue-17913.rs
Auto merge of #106503 - cjgillot:remap-nofilter, r=oli-obk
[rust.git] / tests / ui / limits / issue-17913.rs
1 // build-fail
2 // normalize-stderr-test "\[&usize; \d+\]" -> "[&usize; usize::MAX]"
3 // error-pattern: too big for the current architecture
4
5 // FIXME https://github.com/rust-lang/rust/issues/59774
6 // normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
7 // normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
8
9 #[cfg(target_pointer_width = "64")]
10 fn main() {
11     let n = 0_usize;
12     let a: Box<_> = Box::new([&n; 0xF000000000000000_usize]);
13     println!("{}", a[0xFFFFFF_usize]);
14 }
15
16 #[cfg(target_pointer_width = "32")]
17 fn main() {
18     let n = 0_usize;
19     let a: Box<_> = Box::new([&n; 0xFFFFFFFF_usize]);
20     println!("{}", a[0xFFFFFF_usize]);
21 }