Add a test for that last bug. Oops.
This commit is contained in:
parent
ea8d4d7f17
commit
e5757923cd
1 changed files with 6 additions and 0 deletions
6
src/test/run-fail/small-negative-indexing.rs
Normal file
6
src/test/run-fail/small-negative-indexing.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
fn main() {
|
||||
let v = vec::from_fn(1024u) {|n| n};
|
||||
// this should trip a bounds check
|
||||
log(error, v[-1i8]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue