From e5757923cd1ad20fdee7571aeaa0be445e51f379 Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Wed, 30 May 2012 17:12:50 -0700 Subject: [PATCH] Add a test for that last bug. Oops. --- src/test/run-fail/small-negative-indexing.rs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/test/run-fail/small-negative-indexing.rs 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 00000000000..89aa8c80dc2 --- /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]); +}