about summary refs log tree commit diff
path: root/compiler/rustc_query_system/src
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2022-09-30 10:45:02 -0300
committerSantiago Pastorino <spastorino@gmail.com>2022-09-30 15:12:01 -0300
commitb2bef02bcdc322a42ccde2688f34dce01a0cbb50 (patch)
tree1c6f8774fce41b61709a410bd0c8ff4dea62cf74 /compiler/rustc_query_system/src
parent65445a571c11f07f4ca1ed0f63bad247ae295bd0 (diff)
downloadrust-b2bef02bcdc322a42ccde2688f34dce01a0cbb50.tar.gz
rust-b2bef02bcdc322a42ccde2688f34dce01a0cbb50.zip
create def ids for impl traits during ast lowering
Diffstat (limited to 'compiler/rustc_query_system/src')
-rw-r--r--compiler/rustc_query_system/src/ich/hcx.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_query_system/src/ich/hcx.rs b/compiler/rustc_query_system/src/ich/hcx.rs
index 8140c243453..148eabb38e2 100644
--- a/compiler/rustc_query_system/src/ich/hcx.rs
+++ b/compiler/rustc_query_system/src/ich/hcx.rs
@@ -12,7 +12,7 @@ use rustc_session::cstore::CrateStore;
 use rustc_session::Session;
 use rustc_span::source_map::SourceMap;
 use rustc_span::symbol::Symbol;
-use rustc_span::{BytePos, CachingSourceMapView, SourceFile, Span, SpanData};
+use rustc_span::{BytePos, CachingSourceMapView, SourceFile, Span, SpanData, DUMMY_SP};
 
 /// This is the context state available during incr. comp. hashing. It contains
 /// enough information to transform `DefId`s and `HirId`s into stable `DefPath`s (i.e.,
@@ -185,7 +185,7 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> {
 
     #[inline]
     fn def_span(&self, def_id: LocalDefId) -> Span {
-        self.source_span[def_id]
+        *self.source_span.get(def_id).unwrap_or(&DUMMY_SP)
     }
 
     #[inline]