summaryrefslogtreecommitdiffstats
path: root/tests/ui/reachable/expr_type.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/reachable/expr_type.rs')
-rw-r--r--tests/ui/reachable/expr_type.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/reachable/expr_type.rs b/tests/ui/reachable/expr_type.rs
new file mode 100644
index 000000000..1ceb2f859
--- /dev/null
+++ b/tests/ui/reachable/expr_type.rs
@@ -0,0 +1,12 @@
+#![allow(unused_variables)]
+#![allow(unused_assignments)]
+#![allow(dead_code)]
+#![deny(unreachable_code)]
+#![feature(never_type, type_ascription)]
+
+fn a() {
+ // the cast is unreachable:
+ let x = type_ascribe!({return}, !); //~ ERROR unreachable
+}
+
+fn main() { }