diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-15 06:49:13 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-15 06:49:13 +0100 |
commit | 5ed6a13a2c81f24bd12cc74332f7e94301c73980 (patch) | |
tree | 87a7c456d17459f7c903ac34d3a1f60371762ac3 /crates/ra_syntax/test_data/parser/ok | |
parent | 19e0d7d596015599fd705eecfe6f695aabc8632d (diff) | |
parent | 4f31fed362e1bb08f748b188eedc0bdc5a070bee (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_syntax/test_data/parser/ok')
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rs | 5 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0052_for_range_block.txt | 79 |
2 files changed, 84 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rs b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rs new file mode 100644 index 000000000..b51b19630 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | for _x in 0 .. (0 .. {1 + 2}).sum::<u32>() { | ||
3 | break; | ||
4 | } | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.txt b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.txt new file mode 100644 index 000000000..858f042c6 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.txt | |||
@@ -0,0 +1,79 @@ | |||
1 | SOURCE_FILE@[0; 80) | ||
2 | FN_DEF@[0; 79) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) "(" | ||
9 | R_PAREN@[7; 8) ")" | ||
10 | WHITESPACE@[8; 9) " " | ||
11 | BLOCK@[9; 79) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 14) "\n " | ||
14 | FOR_EXPR@[14; 77) | ||
15 | FOR_KW@[14; 17) "for" | ||
16 | WHITESPACE@[17; 18) " " | ||
17 | BIND_PAT@[18; 20) | ||
18 | NAME@[18; 20) | ||
19 | IDENT@[18; 20) "_x" | ||
20 | WHITESPACE@[20; 21) " " | ||
21 | IN_KW@[21; 23) "in" | ||
22 | WHITESPACE@[23; 24) " " | ||
23 | RANGE_EXPR@[24; 56) | ||
24 | LITERAL@[24; 25) | ||
25 | INT_NUMBER@[24; 25) "0" | ||
26 | WHITESPACE@[25; 26) " " | ||
27 | DOTDOT@[26; 28) ".." | ||
28 | WHITESPACE@[28; 29) " " | ||
29 | METHOD_CALL_EXPR@[29; 56) | ||
30 | PAREN_EXPR@[29; 43) | ||
31 | L_PAREN@[29; 30) "(" | ||
32 | RANGE_EXPR@[30; 42) | ||
33 | LITERAL@[30; 31) | ||
34 | INT_NUMBER@[30; 31) "0" | ||
35 | WHITESPACE@[31; 32) " " | ||
36 | DOTDOT@[32; 34) ".." | ||
37 | WHITESPACE@[34; 35) " " | ||
38 | BLOCK_EXPR@[35; 42) | ||
39 | BLOCK@[35; 42) | ||
40 | L_CURLY@[35; 36) "{" | ||
41 | BIN_EXPR@[36; 41) | ||
42 | LITERAL@[36; 37) | ||
43 | INT_NUMBER@[36; 37) "1" | ||
44 | WHITESPACE@[37; 38) " " | ||
45 | PLUS@[38; 39) "+" | ||
46 | WHITESPACE@[39; 40) " " | ||
47 | LITERAL@[40; 41) | ||
48 | INT_NUMBER@[40; 41) "2" | ||
49 | R_CURLY@[41; 42) "}" | ||
50 | R_PAREN@[42; 43) ")" | ||
51 | DOT@[43; 44) "." | ||
52 | NAME_REF@[44; 47) | ||
53 | IDENT@[44; 47) "sum" | ||
54 | TYPE_ARG_LIST@[47; 54) | ||
55 | COLONCOLON@[47; 49) "::" | ||
56 | L_ANGLE@[49; 50) "<" | ||
57 | TYPE_ARG@[50; 53) | ||
58 | PATH_TYPE@[50; 53) | ||
59 | PATH@[50; 53) | ||
60 | PATH_SEGMENT@[50; 53) | ||
61 | NAME_REF@[50; 53) | ||
62 | IDENT@[50; 53) "u32" | ||
63 | R_ANGLE@[53; 54) ">" | ||
64 | ARG_LIST@[54; 56) | ||
65 | L_PAREN@[54; 55) "(" | ||
66 | R_PAREN@[55; 56) ")" | ||
67 | WHITESPACE@[56; 57) " " | ||
68 | BLOCK@[57; 77) | ||
69 | L_CURLY@[57; 58) "{" | ||
70 | WHITESPACE@[58; 66) "\n " | ||
71 | EXPR_STMT@[66; 72) | ||
72 | BREAK_EXPR@[66; 71) | ||
73 | BREAK_KW@[66; 71) "break" | ||
74 | SEMI@[71; 72) ";" | ||
75 | WHITESPACE@[72; 76) "\n " | ||
76 | R_CURLY@[76; 77) "}" | ||
77 | WHITESPACE@[77; 78) "\n" | ||
78 | R_CURLY@[78; 79) "}" | ||
79 | WHITESPACE@[79; 80) "\n" | ||