rust/tests/fail/intrinsics/raw_eq_on_ptr.rs

11 lines
199 B
Rust
Raw Normal View History

2022-08-12 10:24:55 -05:00
#![feature(intrinsics)]
extern "rust-intrinsic" {
fn raw_eq<T>(a: &T, b: &T) -> bool;
}
fn main() {
let x = &0;
unsafe { raw_eq(&x, &x) }; //~ERROR: `raw_eq` on bytes with provenance
2022-08-12 10:24:55 -05:00
}