mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
11 lines
282 B
Rust
11 lines
282 B
Rust
//@ run-fail
|
|
//@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes
|
|
//@ error-pattern: unsafe precondition(s) violated: slice::from_raw_parts
|
|
//@ ignore-debug
|
|
|
|
fn main() {
|
|
unsafe {
|
|
let _s: &[u8] = std::slice::from_raw_parts(std::ptr::null(), 0);
|
|
}
|
|
}
|