Skip to content

Commit

Permalink
save-analysis: be even more aggressive about ignorning macro-generate…
Browse files Browse the repository at this point in the history
…d defs
  • Loading branch information
nrc committed Nov 14, 2018
1 parent 5c9f7dc commit 547ac5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,11 +658,13 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
impl_items: &'l [ast::ImplItem],
) {
if let Some(impl_data) = self.save_ctxt.get_item_data(item) {
if let super::Data::RelationData(rel, imp) = impl_data {
self.dumper.dump_relation(rel);
self.dumper.dump_impl(imp);
} else {
span_bug!(item.span, "unexpected data kind: {:?}", impl_data);
if !self.span.filter_generated(item.span) {
if let super::Data::RelationData(rel, imp) = impl_data {
self.dumper.dump_relation(rel);
self.dumper.dump_impl(imp);
} else {
span_bug!(item.span, "unexpected data kind: {:?}", impl_data);
}
}
}
self.visit_ty(&typ);
Expand Down
6 changes: 1 addition & 5 deletions src/librustc_save_analysis/span_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,10 @@ impl<'a> SpanUtils<'a> {
/// Used to filter out spans of minimal value,
/// such as references to macro internal variables.
pub fn filter_generated(&self, span: Span) -> bool {
if span.is_dummy() {
if generated_code(span) {
return true;
}

if !generated_code(span) {
return false;
}

//If the span comes from a fake source_file, filter it.
!self.sess
.source_map()
Expand Down

0 comments on commit 547ac5e

Please sign in to comment.