aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar/patterns.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/grammar/patterns.rs')
-rw-r--r--crates/libsyntax2/src/grammar/patterns.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/grammar/patterns.rs b/crates/libsyntax2/src/grammar/patterns.rs
index 436f3b26d..220f36db7 100644
--- a/crates/libsyntax2/src/grammar/patterns.rs
+++ b/crates/libsyntax2/src/grammar/patterns.rs
@@ -60,6 +60,7 @@ fn atom_pat(p: &mut Parser) -> Option<CompletedMarker> {
60// let Bar(..) = (); 60// let Bar(..) = ();
61// } 61// }
62fn path_pat(p: &mut Parser) -> CompletedMarker { 62fn path_pat(p: &mut Parser) -> CompletedMarker {
63 assert!(paths::is_path_start(p));
63 let m = p.start(); 64 let m = p.start();
64 paths::expr_path(p); 65 paths::expr_path(p);
65 let kind = match p.current() { 66 let kind = match p.current() {
@@ -116,8 +117,11 @@ fn struct_pat_fields(p: &mut Parser) {
116 p.bump(); 117 p.bump();
117 pattern(p); 118 pattern(p);
118 } 119 }
119 _ => { 120 REF_KW | MUT_KW | IDENT => {
120 bind_pat(p, false); 121 bind_pat(p, false);
122 },
123 _ => {
124 p.err_and_bump("expected ident");
121 } 125 }
122 } 126 }
123 if !p.at(R_CURLY) { 127 if !p.at(R_CURLY) {