about summary refs log tree commit diff
path: root/tests/ui/inference/inference-variable-behind-raw-pointer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/inference/inference-variable-behind-raw-pointer.rs')
-rw-r--r--tests/ui/inference/inference-variable-behind-raw-pointer.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/inference/inference-variable-behind-raw-pointer.rs b/tests/ui/inference/inference-variable-behind-raw-pointer.rs
new file mode 100644
index 00000000000..6662e46b1c7
--- /dev/null
+++ b/tests/ui/inference/inference-variable-behind-raw-pointer.rs
@@ -0,0 +1,11 @@
+// check-pass
+
+// tests that the following code compiles, but produces a future-compatibility warning
+
+fn main() {
+    let data = std::ptr::null();
+    let _ = &data as *const *const ();
+    if data.is_null() {}
+    //~^ WARNING type annotations needed
+    //~| WARNING this is accepted in the current edition
+}