2010-06-23 23:03:09 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
2011-05-12 14:45:29 -05:00
|
|
|
// error-pattern:bounds check
|
2010-06-23 23:03:09 -05:00
|
|
|
fn main() {
|
2012-07-14 00:57:48 -05:00
|
|
|
let s: ~str = ~"hello";
|
2010-06-23 23:03:09 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
// Bounds-check failure.
|
2012-04-18 19:02:00 -05:00
|
|
|
assert (s[5] == 0x0 as u8);
|
2011-08-19 17:16:48 -05:00
|
|
|
}
|