rust/src/test/run-fail/small-negative-indexing.rs

7 lines
149 B
Rust
Raw Normal View History

// error-pattern:bounds check
2012-05-30 17:12:50 -07:00
fn main() {
let v = vec::from_fn(1024u) {|n| n};
// this should trip a bounds check
log(error, v[-1i8]);
}