2011-03-25 12:19:20 -07:00
|
|
|
// xfail-stage0
|
2010-06-23 21:03:09 -07:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
// error-pattern:bounds check
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let vec[int] v = vec(10, 20);
|
|
|
|
let int x = 0;
|
2011-05-02 17:47:24 -07:00
|
|
|
assert (v.(x) == 10);
|
2010-06-23 21:03:09 -07:00
|
|
|
// Bounds-check failure.
|
2011-05-02 17:47:24 -07:00
|
|
|
assert (v.(x-1) == 20);
|
2010-06-23 21:03:09 -07:00
|
|
|
}
|