summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/if-block-unreachable-expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/if-block-unreachable-expr.rs')
-rw-r--r--tests/ui/parser/if-block-unreachable-expr.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/parser/if-block-unreachable-expr.rs b/tests/ui/parser/if-block-unreachable-expr.rs
new file mode 100644
index 000000000..4063a3370
--- /dev/null
+++ b/tests/ui/parser/if-block-unreachable-expr.rs
@@ -0,0 +1,8 @@
+// check-pass
+
+// This regressed from 1.20 -> 1.21 -- the condition is unreachable,
+// but it's still an expression, and should parse fine.
+
+fn main() {
+ if { if true { return; } else { return; }; } {}
+}