summaryrefslogtreecommitdiffstats
path: root/tests/ui/expr/if/if-loop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/expr/if/if-loop.rs')
-rw-r--r--tests/ui/expr/if/if-loop.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/expr/if/if-loop.rs b/tests/ui/expr/if/if-loop.rs
new file mode 100644
index 000000000..06d0bdf45
--- /dev/null
+++ b/tests/ui/expr/if/if-loop.rs
@@ -0,0 +1,8 @@
+// check-pass
+
+// This used to ICE because the "if" being unreachable was not handled correctly
+fn err() {
+ if loop {} {}
+}
+
+fn main() {}