summaryrefslogtreecommitdiffstats
path: root/src/test/ui/cast/cast-to-infer-ty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/cast/cast-to-infer-ty.rs')
-rw-r--r--src/test/ui/cast/cast-to-infer-ty.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/ui/cast/cast-to-infer-ty.rs b/src/test/ui/cast/cast-to-infer-ty.rs
new file mode 100644
index 000000000..053ebb621
--- /dev/null
+++ b/src/test/ui/cast/cast-to-infer-ty.rs
@@ -0,0 +1,8 @@
+// run-pass
+// Check that we allow a cast to `_` so long as the target type can be
+// inferred elsewhere.
+
+pub fn main() {
+ let i: *const i32 = 0 as _;
+ assert!(i.is_null());
+}