about summary refs log tree commit diff
path: root/compiler/rustc_metadata
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-04-18 14:27:04 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2021-09-10 20:17:33 +0200
commit00485e0c0e8dcd64c57a86d706beb62054921253 (patch)
treed5920e5354a86ea0180d39f7068029f0a33bc296 /compiler/rustc_metadata
parent06f7ca307d7ffdbdafe05eb76cc850eaf716916d (diff)
downloadrust-00485e0c0e8dcd64c57a86d706beb62054921253.tar.gz
rust-00485e0c0e8dcd64c57a86d706beb62054921253.zip
Keep a parent LocalDefId in SpanData.
Diffstat (limited to 'compiler/rustc_metadata')
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs
index dd44e0cb1fa..5f01cfa6a7d 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder.rs
@@ -536,7 +536,8 @@ impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for Span {
         let hi =
             (hi + source_file.translated_source_file.start_pos) - source_file.original_start_pos;
 
-        Ok(Span::new(lo, hi, ctxt))
+        // Do not try to decode parent for foreign spans.
+        Ok(Span::new(lo, hi, ctxt, None))
     }
 }