When a match guard indirectly contains if let
, rustc requires only the let_chains
feature and not also if_let_guard
#93150
Labels
C-bug
Category: This is a bug.
If you compile the following code:
rustc complains as expected:
Playground.
However, if I use the
let_chains
feature, by e.g. wrapping thelet true = true
in parentheses, or adding another clause, it compiles without error:Playground.
It depends only on the
let_chains
feature, instead of bothlet_chains
andif_let_guard
.This is because here:
rust/compiler/rustc_parse/src/parser/expr.rs
Lines 2393 to 2398 in 523be2e
We only gate it under
if_let_guard
if thelet
is directly under the guard node.The text was updated successfully, but these errors were encountered: