rust/tests/ui/indexing/index-bounds.rs

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

11 lines
317 B
Rust
Raw Normal View History

2024-05-31 20:40:46 -05:00
//@ build-fail
fn main() {
let _n = [64][200];
//~^ ERROR this operation will panic at runtime [unconditional_panic]
// issue #121126, test index value between 0xFFFF_FF00 and u32::MAX
let _n = [64][u32::MAX as usize - 1];
//~^ ERROR this operation will panic at runtime [unconditional_panic]
}