mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 15:47:31 +00:00
Parse trait aliases
This commit is contained in:
parent
c2bbfb9a5f
commit
aa433c67d8
3 changed files with 141 additions and 0 deletions
|
@ -10,6 +10,16 @@ pub(super) fn trait_def(p: &mut Parser) {
|
|||
p.bump(T![trait]);
|
||||
name_r(p, ITEM_RECOVERY_SET);
|
||||
type_params::opt_type_param_list(p);
|
||||
// test trait_alias
|
||||
// trait Z<U> = T<U>;
|
||||
// trait Z<U> = T<U> where U: Copy;
|
||||
// trait Z<U> = where Self: T<U>;
|
||||
if p.eat(T![=]) {
|
||||
type_params::bounds_without_colon(p);
|
||||
type_params::opt_where_clause(p);
|
||||
p.expect(T![;]);
|
||||
return;
|
||||
}
|
||||
if p.at(T![:]) {
|
||||
type_params::bounds(p);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue