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