about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-02-05 09:14:49 -0500
committerGitHub <noreply@github.com>2017-02-05 09:14:49 -0500
commitece92408247219084f0a1109bca3634ab8d868f5 (patch)
treedac0bdb28e35cfff91c5732ab56fcfb16f6766cc
parentcd5c520cc23c46de1c207927fb55336915836725 (diff)
parent395f23c9f7c7e1107dce5a05e71b3a9480d4e331 (diff)
downloadrust-ece92408247219084f0a1109bca3634ab8d868f5.tar.gz
rust-ece92408247219084f0a1109bca3634ab8d868f5.zip
Rollup merge of #39453 - nrc:save-path, r=nikomatsakis
save-analysis: be more paranoid about generated paths

fixes https://github.com/rust-lang-nursery/rls/issues/160
-rw-r--r--src/librustc_save_analysis/lib.rs3
-rw-r--r--src/libsyntax/parse/parser.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs
index 8d0cdd1678c..ebb33a12c87 100644
--- a/src/librustc_save_analysis/lib.rs
+++ b/src/librustc_save_analysis/lib.rs
@@ -430,6 +430,9 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
                               -> Option<TypeRefData> {
         self.lookup_ref_id(trait_ref.ref_id).and_then(|def_id| {
             let span = trait_ref.path.span;
+            if generated_code(span) {
+                return None;
+            }
             let sub_span = self.span_utils.sub_span_for_type_name(span).or(Some(span));
             filter!(self.span_utils, sub_span, span, None);
             Some(TypeRefData {
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index fd7c56f136f..45d8354d317 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1691,6 +1691,7 @@ impl<'a> Parser<'a> {
         }
 
         // Assemble the span.
+        // FIXME(#39450) This is bogus if part of the path is macro generated.
         let span = mk_sp(lo, self.prev_span.hi);
 
         // Assemble the result.