mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Lower and handle trait aliases in HIR
This commit is contained in:
parent
e2ec3a6561
commit
29c957f973
47 changed files with 334 additions and 75 deletions
|
@ -374,23 +374,24 @@ impl<'a> Printer<'a> {
|
|||
}
|
||||
w!(self, "trait {}", name);
|
||||
self.print_generic_params(generic_params);
|
||||
match items {
|
||||
Some(items) => {
|
||||
self.print_where_clause_and_opening_brace(generic_params);
|
||||
self.indented(|this| {
|
||||
for item in &**items {
|
||||
this.print_mod_item((*item).into());
|
||||
}
|
||||
});
|
||||
self.print_where_clause_and_opening_brace(generic_params);
|
||||
self.indented(|this| {
|
||||
for item in &**items {
|
||||
this.print_mod_item((*item).into());
|
||||
}
|
||||
None => {
|
||||
w!(self, " = ");
|
||||
// FIXME: Print the aliased traits
|
||||
self.print_where_clause_and_opening_brace(generic_params);
|
||||
}
|
||||
}
|
||||
});
|
||||
wln!(self, "}}");
|
||||
}
|
||||
ModItem::TraitAlias(it) => {
|
||||
let TraitAlias { name, visibility, generic_params, ast_id: _ } = &self.tree[it];
|
||||
self.print_visibility(*visibility);
|
||||
w!(self, "trait {}", name);
|
||||
self.print_generic_params(generic_params);
|
||||
w!(self, " = ");
|
||||
self.print_where_clause(generic_params);
|
||||
w!(self, ";");
|
||||
wln!(self);
|
||||
}
|
||||
ModItem::Impl(it) => {
|
||||
let Impl { target_trait, self_ty, is_negative, items, generic_params, ast_id: _ } =
|
||||
&self.tree[it];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue