summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unsafe/unsafe-fn-deref-ptr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/unsafe/unsafe-fn-deref-ptr.rs')
-rw-r--r--src/test/ui/unsafe/unsafe-fn-deref-ptr.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/unsafe/unsafe-fn-deref-ptr.rs b/src/test/ui/unsafe/unsafe-fn-deref-ptr.rs
new file mode 100644
index 000000000..dc989535b
--- /dev/null
+++ b/src/test/ui/unsafe/unsafe-fn-deref-ptr.rs
@@ -0,0 +1,9 @@
+// revisions: mir thir
+// [thir]compile-flags: -Z thir-unsafeck
+
+fn f(p: *const u8) -> u8 {
+ return *p; //~ ERROR dereference of raw pointer is unsafe
+}
+
+fn main() {
+}