diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-15 19:27:53 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-17 12:14:42 +0200 |
| commit | 07ee0317638cf1f290a8dace1c7ccc8fea16a236 (patch) | |
| tree | 059bd5dcde9ee799551fed543e4e8ff474170678 /compiler/rustc_query_impl/src | |
| parent | 878c7833f6c1ff10e2fd89074e5bd4ef5ff15936 (diff) | |
| download | rust-07ee0317638cf1f290a8dace1c7ccc8fea16a236.tar.gz rust-07ee0317638cf1f290a8dace1c7ccc8fea16a236.zip | |
Stop using CRATE_DEF_INDEX.
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
Diffstat (limited to 'compiler/rustc_query_impl/src')
| -rw-r--r-- | compiler/rustc_query_impl/src/profiling_support.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_query_impl/src/profiling_support.rs b/compiler/rustc_query_impl/src/profiling_support.rs index acccf43f062..b20aa7b5346 100644 --- a/compiler/rustc_query_impl/src/profiling_support.rs +++ b/compiler/rustc_query_impl/src/profiling_support.rs @@ -1,7 +1,7 @@ use measureme::{StringComponent, StringId}; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::profiling::SelfProfiler; -use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE}; +use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, LOCAL_CRATE}; use rustc_hir::definitions::DefPathData; use rustc_middle::ty::{TyCtxt, WithOptConstParam}; use rustc_query_system::query::QueryCache; @@ -143,7 +143,7 @@ impl SpecIntoSelfProfilingString for CrateNum { &self, builder: &mut QueryKeyStringBuilder<'_, '_, '_>, ) -> StringId { - builder.def_id_to_string_id(DefId { krate: *self, index: CRATE_DEF_INDEX }) + builder.def_id_to_string_id(self.as_def_id()) } } |
