aboutsummaryrefslogtreecommitdiff
path: root/src/grammar/items/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/grammar/items/mod.rs')
-rw-r--r--src/grammar/items/mod.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/grammar/items/mod.rs b/src/grammar/items/mod.rs
index 83f1833b5..824f1296c 100644
--- a/src/grammar/items/mod.rs
+++ b/src/grammar/items/mod.rs
@@ -240,7 +240,11 @@ fn fn_item(p: &mut Parser) {
240 // fn foo<T>() where T: Copy {} 240 // fn foo<T>() where T: Copy {}
241 type_params::where_clause(p); 241 type_params::where_clause(p);
242 242
243 expressions::block(p); 243 // test fn_decl
244 // trait T { fn foo(); }
245 if !p.eat(SEMI) {
246 expressions::block(p);
247 }
244} 248}
245 249
246// test type_item 250// test type_item
@@ -255,12 +259,17 @@ fn type_item(p: &mut Parser) {
255 // type Result<T> = (); 259 // type Result<T> = ();
256 type_params::type_param_list(p); 260 type_params::type_param_list(p);
257 261
262 if p.at(COLON) {
263 type_params::bounds(p);
264 }
265
258 // test type_item_where_clause 266 // test type_item_where_clause
259 // type Foo where Foo: Copy = (); 267 // type Foo where Foo: Copy = ();
260 type_params::where_clause(p); 268 type_params::where_clause(p);
261 269
262 p.expect(EQ); 270 if p.eat(EQ) {
263 types::type_(p); 271 types::type_(p);
272 }
264 p.expect(SEMI); 273 p.expect(SEMI);
265} 274}
266 275