summaryrefslogtreecommitdiffstats
path: root/tests/ui/unsafe/unsafe-fn-deref-ptr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/unsafe/unsafe-fn-deref-ptr.rs')
-rw-r--r--tests/ui/unsafe/unsafe-fn-deref-ptr.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/ui/unsafe/unsafe-fn-deref-ptr.rs b/tests/ui/unsafe/unsafe-fn-deref-ptr.rs
index dc989535b..4b7c6bf69 100644
--- a/tests/ui/unsafe/unsafe-fn-deref-ptr.rs
+++ b/tests/ui/unsafe/unsafe-fn-deref-ptr.rs
@@ -2,6 +2,9 @@
// [thir]compile-flags: -Z thir-unsafeck
fn f(p: *const u8) -> u8 {
+ let _ = *p; //~ ERROR dereference of raw pointer is unsafe
+ let _: u8 = *p; //~ ERROR dereference of raw pointer is unsafe
+ _ = *p; //~ ERROR dereference of raw pointer is unsafe
return *p; //~ ERROR dereference of raw pointer is unsafe
}