From 8222a1fddfe73dab5e00437efeffa7d95db0b6be Mon Sep 17 00:00:00 2001 From: Evgenii P Date: Tue, 13 Aug 2019 22:36:01 +0700 Subject: Fix is_path_start to accept T![<], fix is_path_start usages --- crates/ra_parser/src/grammar/types.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_parser/src/grammar/types.rs') diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index 9acc00793..29d173305 100644 --- a/crates/ra_parser/src/grammar/types.rs +++ b/crates/ra_parser/src/grammar/types.rs @@ -29,7 +29,7 @@ fn type_with_bounds_cond(p: &mut Parser, allow_bounds: bool) { T![dyn ] => dyn_trait_type(p), // Some path types are not allowed to have bounds (no plus) T![<] => path_type_(p, allow_bounds), - _ if paths::is_path_start(p) => path_or_macro_type_(p, allow_bounds), + _ if paths::is_use_path_start(p) => path_or_macro_type_(p, allow_bounds), _ => { p.err_recover("expected type", TYPE_RECOVERY_SET); } @@ -213,7 +213,7 @@ pub(super) fn for_type(p: &mut Parser) { match p.current() { T![fn] | T![unsafe] | T![extern] => fn_pointer_type(p), T![&] => reference_type(p), - _ if paths::is_path_start(p) || p.at(T![<]) => path_type_(p, false), + _ if paths::is_path_start(p) => path_type_(p, false), _ => p.error("expected a path"), } m.complete(p, FOR_TYPE); @@ -252,7 +252,7 @@ pub(super) fn path_type(p: &mut Parser) { // type A = foo!(); // type B = crate::foo!(); fn path_or_macro_type_(p: &mut Parser, allow_bounds: bool) { - assert!(paths::is_path_start(p) || p.at(T![<])); + assert!(paths::is_path_start(p)); let m = p.start(); paths::type_path(p); @@ -271,7 +271,7 @@ fn path_or_macro_type_(p: &mut Parser, allow_bounds: bool) { } pub(super) fn path_type_(p: &mut Parser, allow_bounds: bool) { - assert!(paths::is_path_start(p) || p.at(T![<])); + assert!(paths::is_path_start(p)); let m = p.start(); paths::type_path(p); -- cgit v1.2.3