aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar/types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/grammar/types.rs')
-rw-r--r--crates/ra_syntax/src/grammar/types.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/grammar/types.rs b/crates/ra_syntax/src/grammar/types.rs
index 21d89d83b..83a54c190 100644
--- a/crates/ra_syntax/src/grammar/types.rs
+++ b/crates/ra_syntax/src/grammar/types.rs
@@ -36,6 +36,14 @@ fn type_with_bounds_cond(p: &mut Parser, allow_bounds: bool) {
36 } 36 }
37} 37}
38 38
39pub(super) fn is_type_start(p: &mut Parser) -> bool {
40 match p.current() {
41 L_PAREN | EXCL | STAR | L_BRACK | AMP | UNDERSCORE | FN_KW | FOR_KW | IMPL_KW | DYN_KW
42 | L_ANGLE => true,
43 _ => paths::is_path_start(p),
44 }
45}
46
39pub(super) fn ascription(p: &mut Parser) { 47pub(super) fn ascription(p: &mut Parser) {
40 p.expect(COLON); 48 p.expect(COLON);
41 type_(p) 49 type_(p)