Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/items.rs')
| -rw-r--r-- | crates/parser/src/grammar/items.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs index 13d9f9e1ab..517da6e95c 100644 --- a/crates/parser/src/grammar/items.rs +++ b/crates/parser/src/grammar/items.rs @@ -19,7 +19,7 @@ use super::*; // struct S; pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) { attributes::inner_attrs(p); - while !(stop_on_r_curly && p.at(T!['}']) || p.at(EOF)) { + while !p.at(EOF) && !(p.at(T!['}']) && stop_on_r_curly) { item_or_macro(p, stop_on_r_curly) } } @@ -284,15 +284,15 @@ fn type_alias(p: &mut Parser, m: Marker) { // test type_item_type_params // type Result<T> = (); - type_params::opt_generic_param_list(p); + generic_params::opt_generic_param_list(p); if p.at(T![:]) { - type_params::bounds(p); + generic_params::bounds(p); } // test type_item_where_clause // type Foo where Foo: Copy = (); - type_params::opt_where_clause(p); + generic_params::opt_where_clause(p); if p.eat(T![=]) { types::type_(p); } @@ -383,7 +383,7 @@ fn fn_(p: &mut Parser, m: Marker) { name_r(p, ITEM_RECOVERY_SET); // test function_type_params // fn foo<T: Clone + Copy>(){} - type_params::opt_generic_param_list(p); + generic_params::opt_generic_param_list(p); if p.at(T!['(']) { params::param_list_fn_def(p); @@ -397,7 +397,7 @@ fn fn_(p: &mut Parser, m: Marker) { // test function_where_clause // fn foo<T>() where T: Copy {} - type_params::opt_where_clause(p); + generic_params::opt_where_clause(p); if p.at(T![;]) { // test fn_decl |