diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-07-12 22:19:25 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-07-06 22:50:55 +0200 |
| commit | 43bb31b9540a439dcca65f47b8644eafe4a42e2d (patch) | |
| tree | 8c707ae5bb7b76fd39b0b0b811e50fd336e5cd17 /compiler/rustc_query_impl/src/keys.rs | |
| parent | 3dcb616888aac50d55160b025266d555dad937d9 (diff) | |
| download | rust-43bb31b9540a439dcca65f47b8644eafe4a42e2d.tar.gz rust-43bb31b9540a439dcca65f47b8644eafe4a42e2d.zip | |
Allow to create definitions inside the query system.
Diffstat (limited to 'compiler/rustc_query_impl/src/keys.rs')
| -rw-r--r-- | compiler/rustc_query_impl/src/keys.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_query_impl/src/keys.rs b/compiler/rustc_query_impl/src/keys.rs index 6fbafeb1d32..c3fbba4456e 100644 --- a/compiler/rustc_query_impl/src/keys.rs +++ b/compiler/rustc_query_impl/src/keys.rs @@ -39,6 +39,17 @@ impl Key for () { } } +impl Key for ty::RawLocalDefId { + #[inline(always)] + fn query_crate_is_local(&self) -> bool { + true + } + + fn default_span(&self, _: TyCtxt<'_>) -> Span { + DUMMY_SP + } +} + impl<'tcx> Key for ty::InstanceDef<'tcx> { #[inline(always)] fn query_crate_is_local(&self) -> bool { |
