]> git.lizzy.rs Git - rust.git/commitdiff
save-analysis: fix over-zealous filter on generated code
authorNick Cameron <ncameron@mozilla.com>
Mon, 9 Jan 2017 02:07:07 +0000 (15:07 +1300)
committerNick Cameron <ncameron@mozilla.com>
Mon, 9 Jan 2017 02:07:07 +0000 (15:07 +1300)
src/librustc_save_analysis/dump_visitor.rs

index 424017ebd12bb77a33ff8718a592901845e801bf..06e1a492b4da2e9c93f73cb68260e08c557e4188 100644 (file)
@@ -1343,18 +1343,19 @@ fn visit_ty(&mut self, t: &'l ast::Ty) {
         self.process_macro_use(t.span, t.id);
         match t.node {
             ast::TyKind::Path(_, ref path) => {
-                if self.span.filter_generated(None, t.span) {
+                if generated_code(t.span) {
                     return;
                 }
 
                 if let Some(id) = self.lookup_def_id(t.id) {
-                    let sub_span = self.span.sub_span_for_type_name(t.span);
-                    self.dumper.type_ref(TypeRefData {
-                        span: sub_span.expect("No span found for type ref"),
-                        ref_id: Some(id),
-                        scope: self.cur_scope,
-                        qualname: String::new()
-                    }.lower(self.tcx));
+                    if let Some(sub_span) = self.span.sub_span_for_type_name(t.span) {
+                        self.dumper.type_ref(TypeRefData {
+                            span: sub_span,
+                            ref_id: Some(id),
+                            scope: self.cur_scope,
+                            qualname: String::new()
+                        }.lower(self.tcx));
+                    }
                 }
 
                 self.write_sub_paths_truncated(path);