mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix assertione error on block parsing
This commit is contained in:
parent
fed5727ea2
commit
838820ad98
4 changed files with 9 additions and 10 deletions
|
@ -26,7 +26,10 @@ fn expr_no_struct(p: &mut Parser) {
|
|||
// fn c() { 1; 2; }
|
||||
// fn d() { 1; 2 }
|
||||
pub(crate) fn block(p: &mut Parser) {
|
||||
assert!(p.at(L_CURLY));
|
||||
if !p.at(L_CURLY) {
|
||||
p.error("expected a block");
|
||||
return;
|
||||
}
|
||||
let m = p.start();
|
||||
p.bump();
|
||||
while !p.at(EOF) && !p.at(R_CURLY) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue