提交 46dc7c59 编写于 作者: A Alex Burka 提交者: Alex Burka

stub out trait aliases in save_analysis

上级 f1c4a922
......@@ -285,6 +285,7 @@ fn process_def_kind(
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 @@ fn fn_type(path: &ast::Path) -> bool {
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 @@ fn make(&self, offset: usize, _parent_id: Option<NodeId>, scx: &SaveContext) ->
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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册