summaryrefslogtreecommitdiffstats
path: root/tests/ui/reachable/expr_call.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/reachable/expr_call.rs')
-rw-r--r--tests/ui/reachable/expr_call.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/reachable/expr_call.rs b/tests/ui/reachable/expr_call.rs
new file mode 100644
index 000000000..1eaa96c3c
--- /dev/null
+++ b/tests/ui/reachable/expr_call.rs
@@ -0,0 +1,21 @@
+#![feature(never_type)]
+#![allow(unused_variables)]
+#![allow(unused_assignments)]
+#![allow(dead_code)]
+#![deny(unreachable_code)]
+
+fn foo(x: !, y: usize) { }
+
+fn bar(x: !) { }
+
+fn a() {
+ // the `22` is unreachable:
+ foo(return, 22); //~ ERROR unreachable
+}
+
+fn b() {
+ // the call is unreachable:
+ bar(return); //~ ERROR unreachable
+}
+
+fn main() { }