From 838820ad986e04dffa43fc2662a58da27d97db06 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 25 Aug 2018 13:21:43 +0300 Subject: fix assertione error on block parsing --- crates/libsyntax2/src/grammar/items/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/libsyntax2/src/grammar/items') diff --git a/crates/libsyntax2/src/grammar/items/mod.rs b/crates/libsyntax2/src/grammar/items/mod.rs index 44ab92c63..32d0778c4 100644 --- a/crates/libsyntax2/src/grammar/items/mod.rs +++ b/crates/libsyntax2/src/grammar/items/mod.rs @@ -252,10 +252,10 @@ fn function(p: &mut Parser, flavor: ItemFlavor) { // test fn_decl // trait T { fn foo(); } - if p.at(L_CURLY) { - expressions::block(p); + if p.at(SEMI) { + p.bump(); } else { - p.expect(SEMI); + expressions::block(p) } } -- cgit v1.2.3