aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/items.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar/items.rs')
-rw-r--r--crates/ra_parser/src/grammar/items.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs
index ab9d2de90..a057c8167 100644
--- a/crates/ra_parser/src/grammar/items.rs
+++ b/crates/ra_parser/src/grammar/items.rs
@@ -86,9 +86,15 @@ pub(super) fn maybe_item(p: &mut Parser, flavor: ItemFlavor) -> MaybeItem {
86 } 86 }
87 87
88 let mut has_mods = false; 88 let mut has_mods = false;
89
89 // modifiers 90 // modifiers
91 // test_err async_without_semicolon
92 // fn foo() { let _ = async {} }
90 has_mods |= p.eat(CONST_KW); 93 has_mods |= p.eat(CONST_KW);
91 94 if p.at(ASYNC_KW) && p.nth(1) != L_CURLY {
95 p.eat(ASYNC_KW);
96 has_mods = true;
97 }
92 // test_err unsafe_block_in_mod 98 // test_err unsafe_block_in_mod
93 // fn foo(){} unsafe { } fn bar(){} 99 // fn foo(){} unsafe { } fn bar(){}
94 if p.at(UNSAFE_KW) && p.nth(1) != L_CURLY { 100 if p.at(UNSAFE_KW) && p.nth(1) != L_CURLY {
@@ -110,6 +116,9 @@ pub(super) fn maybe_item(p: &mut Parser, flavor: ItemFlavor) -> MaybeItem {
110 116
111 // items 117 // items
112 let kind = match p.current() { 118 let kind = match p.current() {
119 // test async_fn
120 // async fn foo() {}
121
113 // test extern_fn 122 // test extern_fn
114 // extern fn foo() {} 123 // extern fn foo() {}
115 124