mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
12 lines
245 B
Rust
12 lines
245 B
Rust
//@ run-fail
|
|
//@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes
|
|
//@ error-pattern: slice::get_unchecked requires
|
|
//@ ignore-debug
|
|
|
|
fn main() {
|
|
unsafe {
|
|
let sli: &[u8] = &[0];
|
|
sli.get_unchecked(1);
|
|
}
|
|
}
|