mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Merge #1685
1685: fix error of RangeFrom in for-loop r=DJMcNab a=bravomikekilo fix [issue-1542](https://github.com/rust-analyzer/rust-analyzer/issues/1542) @matklad Co-authored-by: bravomikekilo <bmk1221@126.com>
This commit is contained in:
commit
5ed6a13a2c
5 changed files with 142 additions and 1 deletions
|
@ -110,7 +110,19 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
|
|||
p.bump();
|
||||
block_expr(p, Some(m))
|
||||
}
|
||||
T!['{'] => block_expr(p, None),
|
||||
T!['{'] => {
|
||||
// test for_range_from
|
||||
// fn foo() {
|
||||
// for x in 0 .. {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
if r.forbid_structs {
|
||||
return None;
|
||||
} else {
|
||||
block_expr(p, None)
|
||||
}
|
||||
}
|
||||
T![return] => return_expr(p),
|
||||
T![continue] => continue_expr(p),
|
||||
T![break] => break_expr(p, r),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue