mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 19:53:46 +00:00
stub out trait aliases in save_analysis
This commit is contained in:
parent
f1c4a922fe
commit
46dc7c59de
@ -285,6 +285,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
|
||||
HirDef::Enum(..) |
|
||||
HirDef::TyAlias(..) |
|
||||
HirDef::TyForeign(..) |
|
||||
HirDef::TraitAlias(..) |
|
||||
HirDef::Trait(_) => {
|
||||
let span = self.span_from_span(sub_span.expect("No span found for type ref"));
|
||||
self.dumper.dump_ref(Ref {
|
||||
|
@ -721,6 +721,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
|
||||
HirDef::Enum(def_id) |
|
||||
HirDef::TyAlias(def_id) |
|
||||
HirDef::TyForeign(def_id) |
|
||||
HirDef::TraitAlias(def_id) |
|
||||
HirDef::AssociatedTy(def_id) |
|
||||
HirDef::Trait(def_id) |
|
||||
HirDef::TyParam(def_id) => {
|
||||
|
@ -487,6 +487,25 @@ impl Sig for ast::Item {
|
||||
|
||||
Ok(sig)
|
||||
}
|
||||
ast::ItemKind::TraitAlias(ref generics, ref bounds) => {
|
||||
let mut text = String::new();
|
||||
text.push_str("trait ");
|
||||
let mut sig = name_and_generics(text,
|
||||
offset,
|
||||
generics,
|
||||
self.id,
|
||||
self.ident,
|
||||
scx)?;
|
||||
|
||||
if !bounds.is_empty() {
|
||||
sig.text.push_str(" = ");
|
||||
sig.text.push_str(&pprust::bounds_to_string(bounds));
|
||||
}
|
||||
// FIXME where clause
|
||||
sig.text.push_str(";");
|
||||
|
||||
Ok(sig)
|
||||
}
|
||||
ast::ItemKind::AutoImpl(unsafety, ref trait_ref) => {
|
||||
let mut text = String::new();
|
||||
if unsafety == ast::Unsafety::Unsafe {
|
||||
|
Loading…
Reference in New Issue
Block a user