2011-03-25 12:19:20 -07:00
|
|
|
// xfail-stage0
|
2011-05-03 18:13:51 -07:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
2010-06-23 21:03:09 -07:00
|
|
|
// -*- rust -*-
|
|
|
|
|
2011-05-12 17:24:54 +02:00
|
|
|
// error-pattern::bounds check
|
2010-06-23 21:03:09 -07:00
|
|
|
|
|
|
|
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
|
|
|
}
|