summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unsafe-pointer-assignability.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/unsafe-pointer-assignability.rs')
-rw-r--r--src/test/ui/unsafe-pointer-assignability.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/unsafe-pointer-assignability.rs b/src/test/ui/unsafe-pointer-assignability.rs
new file mode 100644
index 000000000..db822bb6a
--- /dev/null
+++ b/src/test/ui/unsafe-pointer-assignability.rs
@@ -0,0 +1,11 @@
+// run-pass
+
+fn f(x: *const isize) {
+ unsafe {
+ assert_eq!(*x, 3);
+ }
+}
+
+pub fn main() {
+ f(&3);
+}