Skip to content

Commit 6a295fc

Browse files
committed
fix: add a check for if token in patterns parser
Closes rust-lang#13776
1 parent 95671d5 commit 6a295fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/parser/src/grammar/patterns.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ fn pattern_single_r(p: &mut Parser<'_>, recovery_set: TokenSet) {
126126
// ^
127127
// `[0..]`
128128
// ^
129-
if matches!(p.current(), T![=] | T![,] | T![:] | T![')'] | T!['}'] | T![']']) {
129+
if matches!(
130+
p.current(),
131+
T![=] | T![,] | T![:] | T![')'] | T!['}'] | T![']'] | T![if]
132+
) {
130133
// test half_open_range_pat
131134
// fn f() {
132135
// let 0 .. = 1u32;

0 commit comments

Comments
 (0)