7 lines
149 B
Rust
7 lines
149 B
Rust
// error-pattern:bounds check
|
|
fn main() {
|
|
let v = vec::from_fn(1024u) {|n| n};
|
|
// this should trip a bounds check
|
|
log(error, v[-1i8]);
|
|
}
|