about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-12-09 18:43:33 +0000
committerbors <bors@rust-lang.org>2016-12-09 18:43:33 +0000
commite9aa73d2bf3c94bc4ff32afeb2b20f28c677dafa (patch)
treea80ee262ac7dc24b92565fed7f06dad1e43ad2a8 /src
parent51d29343c04a27570a8ff8282611007d6e6408de (diff)
parentc6b64f76cf6d22c0a325dd980b4400ac96a9cbc8 (diff)
downloadrust-e9aa73d2bf3c94bc4ff32afeb2b20f28c677dafa.tar.gz
rust-e9aa73d2bf3c94bc4ff32afeb2b20f28c677dafa.zip
Auto merge of #38203 - nrc:save-wr, r=eddyb
save-analysis: fix a few generated code errors
Diffstat (limited to 'src')
-rw-r--r--src/librustc_save_analysis/dump_visitor.rs18
-rw-r--r--src/librustc_save_analysis/lib.rs2
2 files changed, 11 insertions, 9 deletions
diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs
index ec368c6bc1f..afa78a05a63 100644
--- a/src/librustc_save_analysis/dump_visitor.rs
+++ b/src/librustc_save_analysis/dump_visitor.rs
@@ -1326,16 +1326,18 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
         self.process_macro_use(t.span, t.id);
         match t.node {
             ast::TyKind::Path(_, ref path) => {
+                if self.span.filter_generated(None, 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);
-                    if !self.span.filter_generated(sub_span, 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));
-                    }
+                    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));
                 }
 
                 self.write_sub_paths_truncated(path, false);
diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs
index b5cf8141da2..0c910240b60 100644
--- a/src/librustc_save_analysis/lib.rs
+++ b/src/librustc_save_analysis/lib.rs
@@ -250,8 +250,8 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
                 match typ.node {
                     // Common case impl for a struct or something basic.
                     ast::TyKind::Path(None, ref path) => {
+                        filter!(self.span_utils, None, path.span, None);
                         sub_span = self.span_utils.sub_span_for_type_name(path.span);
-                        filter!(self.span_utils, sub_span, path.span, None);
                         type_data = self.lookup_ref_id(typ.id).map(|id| {
                             TypeRefData {
                                 span: sub_span.unwrap(),