summaryrefslogtreecommitdiffstats
path: root/src/test/ui/parser/if-block-unreachable-expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/parser/if-block-unreachable-expr.rs')
-rw-r--r--src/test/ui/parser/if-block-unreachable-expr.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/ui/parser/if-block-unreachable-expr.rs b/src/test/ui/parser/if-block-unreachable-expr.rs
new file mode 100644
index 000000000..4063a3370
--- /dev/null
+++ b/src/test/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; }; } {}
+}