rust/src/test/run-fail/vec-underrun.rs
Patrick Walton 147a2d655f Un-revert "Use different syntax for checks that matter to typestate", fixing the problem.
This reverts commit d08b443fffb1181d8d45ae5d061412f202dd4118.
2011-05-02 17:50:46 -07:00

13 lines
204 B
Rust

// xfail-stage0
// -*- rust -*-
// error-pattern:bounds check
fn main() {
let vec[int] v = vec(10, 20);
let int x = 0;
assert (v.(x) == 10);
// Bounds-check failure.
assert (v.(x-1) == 20);
}