Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/patterns.rs')
-rw-r--r--crates/parser/src/grammar/patterns.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/parser/src/grammar/patterns.rs b/crates/parser/src/grammar/patterns.rs
index 39ded41bb2..5036742337 100644
--- a/crates/parser/src/grammar/patterns.rs
+++ b/crates/parser/src/grammar/patterns.rs
@@ -323,6 +323,15 @@ fn record_pat_field(p: &mut Parser<'_>) {
p.bump(T![:]);
pattern(p);
}
+ // test_err record_pat_field_eq_recovery
+ // fn main() {
+ // let S { field = foo };
+ // }
+ IDENT | INT_NUMBER if p.nth(1) == T![=] => {
+ name_ref_or_index(p);
+ p.err_and_bump("expected `:`");
+ pattern(p);
+ }
T![box] => {
// FIXME: not all box patterns should be allowed
box_pat(p);