]> git.lizzy.rs Git - rust.git/blob - src/test/ui/limits/issue-17913.rs
Rollup merge of #95534 - jyn514:std-mem-copy, r=joshtriplett
[rust.git] / src / test / ui / limits / issue-17913.rs
1 // build-fail
2 // normalize-stderr-test "\[&usize; \d+\]" -> "[&usize; N]"
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 #![feature(box_syntax)]
10
11 #[cfg(target_pointer_width = "64")]
12 fn main() {
13     let n = 0_usize;
14     let a: Box<_> = box [&n; 0xF000000000000000_usize];
15     println!("{}", a[0xFFFFFF_usize]);
16 }
17
18 #[cfg(target_pointer_width = "32")]
19 fn main() {
20     let n = 0_usize;
21     let a: Box<_> = box [&n; 0xFFFFFFFF_usize];
22     println!("{}", a[0xFFFFFF_usize]);
23 }