diff options
Diffstat (limited to 'crates/ra_parser')
-rw-r--r-- | crates/ra_parser/src/grammar/items.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 7263c4d69..54284c933 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs | |||
@@ -91,13 +91,6 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul | |||
91 | // modifiers | 91 | // modifiers |
92 | has_mods |= p.eat(T![const]); | 92 | has_mods |= p.eat(T![const]); |
93 | 93 | ||
94 | // test_err unsafe_block_in_mod | ||
95 | // fn foo(){} unsafe { } fn bar(){} | ||
96 | if p.at(T![unsafe]) && p.nth(1) != T!['{'] { | ||
97 | p.eat(T![unsafe]); | ||
98 | has_mods = true; | ||
99 | } | ||
100 | |||
101 | // test_err async_without_semicolon | 94 | // test_err async_without_semicolon |
102 | // fn foo() { let _ = async {} } | 95 | // fn foo() { let _ = async {} } |
103 | if p.at(T![async]) && p.nth(1) != T!['{'] && p.nth(1) != T![move] && p.nth(1) != T![|] { | 96 | if p.at(T![async]) && p.nth(1) != T!['{'] && p.nth(1) != T![move] && p.nth(1) != T![|] { |
@@ -105,6 +98,13 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul | |||
105 | has_mods = true; | 98 | has_mods = true; |
106 | } | 99 | } |
107 | 100 | ||
101 | // test_err unsafe_block_in_mod | ||
102 | // fn foo(){} unsafe { } fn bar(){} | ||
103 | if p.at(T![unsafe]) && p.nth(1) != T!['{'] { | ||
104 | p.eat(T![unsafe]); | ||
105 | has_mods = true; | ||
106 | } | ||
107 | |||
108 | if p.at(T![extern]) { | 108 | if p.at(T![extern]) { |
109 | has_mods = true; | 109 | has_mods = true; |
110 | abi(p); | 110 | abi(p); |
@@ -157,11 +157,11 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul | |||
157 | // unsafe fn foo() {} | 157 | // unsafe fn foo() {} |
158 | 158 | ||
159 | // test combined_fns | 159 | // test combined_fns |
160 | // unsafe async fn foo() {} | 160 | // async unsafe fn foo() {} |
161 | // const unsafe fn bar() {} | 161 | // const unsafe fn bar() {} |
162 | 162 | ||
163 | // test_err wrong_order_fns | 163 | // test_err wrong_order_fns |
164 | // async unsafe fn foo() {} | 164 | // unsafe async fn foo() {} |
165 | // unsafe const fn bar() {} | 165 | // unsafe const fn bar() {} |
166 | T![fn] => { | 166 | T![fn] => { |
167 | fn_def(p); | 167 | fn_def(p); |