8000 Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering by Centril · Pull Request #66197 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Push ast::{ItemKind, ImplItemKind}::OpaqueTy hack down into lowering #66197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TAIT: adjust save-analysis
  • Loading branch information
Centril committed Nov 14, 2019
commit 89b5907357c3933dc84c60eaea5dfe82cf634933
38 changes: 0 additions & 38 deletions src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1133,12 +1133,6 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
// trait.
self.visit_ty(ty)
}
ast::ImplItemKind::OpaqueTy(ref bounds) => {
// FIXME: uses of the assoc type should ideally point to this
// 'def' and the name here should be a ref to the def in the
// trait.
self.process_bounds(&bounds);
}
ast::ImplItemKind::Macro(_) => {}
}
}
Expand Down Expand Up @@ -1384,38 +1378,6 @@ impl<'l, 'tcx> Visitor<'l> for DumpVisitor<'l, 'tcx> {
self.visit_ty(&ty);
self.process_generic_params(ty_params, &qualname, item.id);
}
OpaqueTy(ref bounds, ref ty_params) => {
let qualname = format!("::{}",
self.tcx.def_path_str(self.tcx.hir().local_def_id_from_node_id(item.id)));

let value = String::new();
if !self.span.filter_generated(item.ident.span) {
let span = self.span_from_span(item.ident.span);
let id = id_from_node_id(item.id, &self.save_ctxt);
let hir_id = self.tcx.hir().node_to_hir_id(item.id);

self.dumper.dump_def(
&access_from!(self.save_ctxt, item, hir_id),
Def {
kind: DefKind::Type,
id,
span,
name: item.ident.to_string(),
qualname: qualname.clone(),
value,
parent: None,
children: vec![],
decl_id: None,
docs: self.save_ctxt.docs_for_attrs(&item.attrs),
sig: sig::item_signature(item, &self.save_ctxt),
attributes: lower_attributes(item.attrs.clone(), &self.save_ctxt),
},
);
}

self.process_bounds(bounds);
self.process_generic_params(ty_params, &qualname, item.id);
}
Mac(_) => (),
_ => visit::walk_item(self, item),
}
Expand Down
10 changes: 0 additions & 10 deletions src/librustc_save_analysis/sig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,16 +447,6 @@ impl Sig for ast::Item {

Ok(merge_sigs(sig.text.clone(), vec![sig, ty]))
}
ast::ItemKind::OpaqueTy(ref bounds, ref generics) => {
let text = "type ".to_owned();
let mut sig = name_and_generics(text, offset, generics, self.id, self.ident, scx)?;

sig.text.push_str(" = impl ");
sig.text.push_str(&pprust::bounds_to_string(bounds));
sig.text.push(';');

Ok(sig)
}
ast::ItemKind::Enum(_, ref generics) => {
let text = "enum ".to_owned();
let mut sig = name_and_generics(text, offset, generics, self.id, self.ident, scx)?;
Expand Down
0