2014-09-02 11:25:01 +12:00
|
|
|
// Test bounds checking for DST raw slices
|
2020-04-16 15:50:32 +09:00
|
|
|
|
|
|
|
//@ run-fail
|
2014-09-02 11:25:01 +12:00
|
|
|
//@ error-pattern:index out of bounds
|
2020-05-08 00:39:02 +09:00
|
|
|
//@ ignore-emscripten no processes
|
|
|
|
|
2020-04-23 12:25:28 -04:00
|
|
|
#[allow(unconditional_panic)]
|
2014-09-02 11:25:01 +12:00
|
|
|
fn main() {
|
2015-01-25 22:05:03 +01:00
|
|
|
let a: *const [_] = &[1, 2, 3];
|
2014-09-02 11:25:01 +12:00
|
|
|
unsafe {
|
|
|
|
let _b = (*a)[3];
|
|
|
|
}
|
|
|
|
}
|