mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Safer errors
This commit is contained in:
parent
c1a7b72fb7
commit
51f7f937a5
3 changed files with 22 additions and 21 deletions
|
@ -129,7 +129,7 @@ fn name(p: &mut Parser) {
|
|||
p.bump();
|
||||
m.complete(p, NAME);
|
||||
} else {
|
||||
p.error("expected a name");
|
||||
p.err_and_bump("expected a name");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ fn name_ref(p: &mut Parser) {
|
|||
p.bump();
|
||||
m.complete(p, NAME_REF);
|
||||
} else {
|
||||
p.error("expected identifier");
|
||||
p.err_and_bump("expected identifier");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -117,11 +117,8 @@ fn struct_pat_fields(p: &mut Parser) {
|
|||
p.bump();
|
||||
pattern(p);
|
||||
}
|
||||
REF_KW | MUT_KW | IDENT => {
|
||||
bind_pat(p, false);
|
||||
},
|
||||
_ => {
|
||||
p.err_and_bump("expected ident");
|
||||
bind_pat(p, false);
|
||||
}
|
||||
}
|
||||
if !p.at(R_CURLY) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue