aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-08-15 06:49:13 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-08-15 06:49:13 +0100
commit5ed6a13a2c81f24bd12cc74332f7e94301c73980 (patch)
tree87a7c456d17459f7c903ac34d3a1f60371762ac3 /crates/ra_parser/src/grammar
parent19e0d7d596015599fd705eecfe6f695aabc8632d (diff)
parent4f31fed362e1bb08f748b188eedc0bdc5a070bee (diff)
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 <[email protected]>
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r--crates/ra_parser/src/grammar/expressions/atom.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs
index 401c738a3..bc942ae01 100644
--- a/crates/ra_parser/src/grammar/expressions/atom.rs
+++ b/crates/ra_parser/src/grammar/expressions/atom.rs
@@ -110,7 +110,19 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
110 p.bump(); 110 p.bump();
111 block_expr(p, Some(m)) 111 block_expr(p, Some(m))
112 } 112 }
113 T!['{'] => block_expr(p, None), 113 T!['{'] => {
114 // test for_range_from
115 // fn foo() {
116 // for x in 0 .. {
117 // break;
118 // }
119 // }
120 if r.forbid_structs {
121 return None;
122 } else {
123 block_expr(p, None)
124 }
125 }
114 T![return] => return_expr(p), 126 T![return] => return_expr(p),
115 T![continue] => continue_expr(p), 127 T![continue] => continue_expr(p),
116 T![break] => break_expr(p, r), 128 T![break] => break_expr(p, r),