Skip to content

Commit

Permalink
Auto merge of #55936 - nrc:save-rename, r=eddyb
Browse files Browse the repository at this point in the history
save-analysis: be even more aggressive about ignorning macro-generated defs

r? @eddyb
  • Loading branch information
bors committed Nov 16, 2018
2 parents 6b9b97b + 547ac5e commit ee82173
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 ee82173

Please sign in to comment.