Skip to content

Commit 623faef

Browse files
committed
Cleanup inline tests
1 parent 642a339 commit 623faef

File tree

9 files changed

+63
-32
lines changed

9 files changed

+63
-32
lines changed

crates/ra_parser/src/grammar/expressions/atom.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
9292
T![loop] => loop_expr(p, Some(m)),
9393
T![for] => for_expr(p, Some(m)),
9494
T![while] => while_expr(p, Some(m)),
95+
// test labeled_block
96+
// fn f() { 'label: {}; }
9597
T!['{'] => {
9698
block_expr(p);
9799
m.complete(p, EFFECT_EXPR)
@@ -115,6 +117,8 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
115117
m.complete(p, EFFECT_EXPR)
116118
}
117119
T![match] => match_expr(p),
120+
// test unsafe_block
121+
// fn f() { unsafe { } }
118122
T![unsafe] if la == T!['{'] => {
119123
let m = p.start();
120124
p.bump(T![unsafe]);
@@ -466,8 +470,6 @@ fn match_guard(p: &mut Parser) -> CompletedMarker {
466470
// test block_expr
467471
// fn foo() {
468472
// {};
469-
// unsafe {};
470-
// 'label: {};
471473
// }
472474
pub(super) fn block_expr(p: &mut Parser) -> CompletedMarker {
473475
assert!(p.at(T!['{']));
Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
SOURCE_FILE@0..52
2-
FN_DEF@0..51
1+
SOURCE_FILE@0..21
2+
FN_DEF@0..20
33
44
55
@@ -8,34 +8,14 @@ [email protected]
88
99
1010
11-
BLOCK_EXPR@9..51
11+
BLOCK_EXPR@9..20
1212
1313
1414
1515
1616
1717
1818
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
41-
19+
20+
21+
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
fn foo() {
22
{};
3-
unsafe {};
4-
'label: {};
53
}

crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ [email protected]
1515
1616
1717
18-
EFFECT_EXPR@17..29
18+
TRY_EXPR@17..29
1919
2020
2121

crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ [email protected]
3939
4040
4141
42-
EFFECT_EXPR@43..55
42+
TRY_EXPR@43..55
4343
4444
4545
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fn f() { 'label: {}; }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fn f() { unsafe { } }

0 commit comments

Comments
 (0)