mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
11 lines
272 B
Rust
11 lines
272 B
Rust
|
//@ run-fail
|
||
|
//@ compile-flags: -Copt-level=3 -Cdebug-assertions=yes
|
||
|
//@ error-pattern: unsafe precondition(s) violated: slice::from_raw_parts
|
||
|
//@ ignore-debug
|
||
|
|
||
|
fn main() {
|
||
|
unsafe {
|
||
|
let _s: &[u64] = std::slice::from_raw_parts(1usize as *const u64, 0);
|
||
|
}
|
||
|
}
|