aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src
diff options
context:
space:
mode:
authorEmil Lauridsen <[email protected]>2020-01-09 17:29:43 +0000
committerEmil Lauridsen <[email protected]>2020-01-09 17:40:01 +0000
commitaa433c67d85c5e56c1343ac5eb62872502ca8d55 (patch)
treedb971989f71796845e9e7cd5396d6b49be61a0a9 /crates/ra_parser/src
parentc2bbfb9a5f614719c9805c7921653c8e4b85b1f1 (diff)
Parse trait aliases
Diffstat (limited to 'crates/ra_parser/src')
-rw-r--r--crates/ra_parser/src/grammar/items/traits.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_parser/src/grammar/items/traits.rs b/crates/ra_parser/src/grammar/items/traits.rs
index 964fd3041..03dae3cdb 100644
--- a/crates/ra_parser/src/grammar/items/traits.rs
+++ b/crates/ra_parser/src/grammar/items/traits.rs
@@ -10,6 +10,16 @@ pub(super) fn trait_def(p: &mut Parser) {
10 p.bump(T![trait]); 10 p.bump(T![trait]);
11 name_r(p, ITEM_RECOVERY_SET); 11 name_r(p, ITEM_RECOVERY_SET);
12 type_params::opt_type_param_list(p); 12 type_params::opt_type_param_list(p);
13 // test trait_alias
14 // trait Z<U> = T<U>;
15 // trait Z<U> = T<U> where U: Copy;
16 // trait Z<U> = where Self: T<U>;
17 if p.eat(T![=]) {
18 type_params::bounds_without_colon(p);
19 type_params::opt_where_clause(p);
20 p.expect(T![;]);
21 return;
22 }
13 if p.at(T![:]) { 23 if p.at(T![:]) {
14 type_params::bounds(p); 24 type_params::bounds(p);
15 } 25 }