Skip to content

Commit f2710f9

Browse files
committed
Rollup merge of rust-lang#55936 - nrc:save-rename, r=eddyb
save-analysis: be even more aggressive about ignorning macro-generated defs r? @eddyb
2 parents a24e025 + 547ac5e commit f2710f9

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/librustc_save_analysis/dump_visitor.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -658,11 +658,13 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
658658
impl_items: &'l [ast::ImplItem],
659659
) {
660660
if let Some(impl_data) = self.save_ctxt.get_item_data(item) {
661-
if let super::Data::RelationData(rel, imp) = impl_data {
662-
self.dumper.dump_relation(rel);
663-
self.dumper.dump_impl(imp);
664-
} else {
665-
span_bug!(item.span, "unexpected data kind: {:?}", impl_data);
661+
if !self.span.filter_generated(item.span) {
662+
if let super::Data::RelationData(rel, imp) = impl_data {
663+
self.dumper.dump_relation(rel);
664+
self.dumper.dump_impl(imp);
665+
} else {
666+
span_bug!(item.span, "unexpected data kind: {:?}", impl_data);
667+
}
666668
}
667669
}
668670
self.visit_ty(&typ);

src/librustc_save_analysis/span_utils.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,10 @@ impl<'a> SpanUtils<'a> {
124124
/// Used to filter out spans of minimal value,
125125
/// such as references to macro internal variables.
126126
pub fn filter_generated(&self, span: Span) -> bool {
127-
if span.is_dummy() {
127+
if generated_code(span) {
128128
return true;
129129
}
130130

131-
if !generated_code(span) {
132-
return false;
133-
}
134-
135131
//If the span comes from a fake source_file, filter it.
136132
!self.sess
137133
.source_map()

0 commit comments

Comments
 (0)