mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
13 lines
271 B
Rust
13 lines
271 B
Rust
//@ run-fail
|
|
//@ compile-flags: -Copt-level=3 -Cdebug-assertions=yes
|
|
//@ error-pattern: slice::get_unchecked requires
|
|
//@ ignore-debug
|
|
//@ ignore-wasm32-bare no panic messages
|
|
|
|
fn main() {
|
|
unsafe {
|
|
let sli: &[u8] = &[0];
|
|
sli.get_unchecked(1);
|
|
}
|
|
}
|