rust/tests/ui/limits/issue-17913.rs

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

18 lines
479 B
Rust
Raw Normal View History

//@ build-fail
//@ normalize-stderr-test: "\[&usize; \d+\]" -> "[&usize; usize::MAX]"
2024-09-20 07:39:10 +00:00
//@ error-pattern: too big for the target architecture
2014-10-14 22:53:37 +00:00
2015-01-16 15:01:02 +00:00
#[cfg(target_pointer_width = "64")]
2014-10-14 22:53:37 +00:00
fn main() {
let n = 0_usize;
let a: Box<_> = Box::new([&n; 0xF000000000000000_usize]);
println!("{}", a[0xFFFFFF_usize]);
2014-10-14 22:53:37 +00:00
}
2014-10-18 16:34:00 +00:00
2015-01-16 15:01:02 +00:00
#[cfg(target_pointer_width = "32")]
fn main() {
let n = 0_usize;
let a: Box<_> = Box::new([&n; 0xFFFFFFFF_usize]);
println!("{}", a[0xFFFFFF_usize]);
}