diff --git a/src/test/run-fail/small-negative-indexing.rs b/src/test/run-fail/small-negative-indexing.rs new file mode 100644 index 000000000000..89aa8c80dc2b --- /dev/null +++ b/src/test/run-fail/small-negative-indexing.rs @@ -0,0 +1,6 @@ + +fn main() { + let v = vec::from_fn(1024u) {|n| n}; + // this should trip a bounds check + log(error, v[-1i8]); +}