rust/tests/ui/unsafe/unsafe-fn-deref-ptr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
295 B
Rust
Raw Normal View History

2014-06-25 19:47:34 +00:00
fn f(p: *const u8) -> u8 {
let _ = *p; //~ ERROR dereference of raw pointer is unsafe
2022-10-18 18:41:14 +00:00
let _: u8 = *p; //~ ERROR dereference of raw pointer is unsafe
2022-11-26 13:34:39 +00:00
_ = *p; //~ ERROR dereference of raw pointer is unsafe
return *p; //~ ERROR dereference of raw pointer is unsafe
}
fn main() {
}