diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2022-09-30 10:45:02 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2022-09-30 15:12:01 -0300 |
| commit | b2bef02bcdc322a42ccde2688f34dce01a0cbb50 (patch) | |
| tree | 1c6f8774fce41b61709a410bd0c8ff4dea62cf74 /compiler/rustc_middle/src/hir/map | |
| parent | 65445a571c11f07f4ca1ed0f63bad247ae295bd0 (diff) | |
| download | rust-b2bef02bcdc322a42ccde2688f34dce01a0cbb50.tar.gz rust-b2bef02bcdc322a42ccde2688f34dce01a0cbb50.zip | |
create def ids for impl traits during ast lowering
Diffstat (limited to 'compiler/rustc_middle/src/hir/map')
| -rw-r--r-- | compiler/rustc_middle/src/hir/map/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index b5f7b26ea7a..8523b5ca0ec 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -14,7 +14,7 @@ use rustc_index::vec::Idx; use rustc_middle::hir::nested_filter; use rustc_span::def_id::StableCrateId; use rustc_span::symbol::{kw, sym, Ident, Symbol}; -use rustc_span::Span; +use rustc_span::{Span, DUMMY_SP}; use rustc_target::spec::abi::Abi; #[inline] @@ -1131,7 +1131,7 @@ pub(super) fn crate_hash(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Svh { .filter_map(|(def_id, info)| { let _ = info.as_owner()?; let def_path_hash = definitions.def_path_hash(def_id); - let span = resolutions.source_span[def_id]; + let span = resolutions.source_span.get(def_id).unwrap_or(&DUMMY_SP); debug_assert_eq!(span.parent(), None); Some((def_path_hash, span)) }) |
