mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-12 12:06:47 +00:00
save-analysis: be even more aggressive about ignorning macro-generated defs
This commit is contained in:
parent
5c9f7dcd83
commit
547ac5ef0a
@ -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);
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user