diff options
| author | 5225225 <5225225@mailbox.org> | 2022-07-14 22:42:47 +0100 | 
|---|---|---|
| committer | 5225225 <5225225@mailbox.org> | 2022-07-14 22:55:17 +0100 | 
| commit | 27412d1e3e128349bc515c16ce882860e20f037d (patch) | |
| tree | 81857e48569def091e13e509a418b4ad54ae212b /compiler/rustc_query_impl/src/keys.rs | |
| parent | c2f428d2f3340a0e7d995f4726223db91b93704c (diff) | |
| download | rust-27412d1e3e128349bc515c16ce882860e20f037d.tar.gz rust-27412d1e3e128349bc515c16ce882860e20f037d.zip | |
Use constant eval to do strict validity checks
Diffstat (limited to 'compiler/rustc_query_impl/src/keys.rs')
| -rw-r--r-- | compiler/rustc_query_impl/src/keys.rs | 12 | 
1 files changed, 11 insertions, 1 deletions
| diff --git a/compiler/rustc_query_impl/src/keys.rs b/compiler/rustc_query_impl/src/keys.rs index 6fbafeb1d32..54774314313 100644 --- a/compiler/rustc_query_impl/src/keys.rs +++ b/compiler/rustc_query_impl/src/keys.rs @@ -6,7 +6,7 @@ use rustc_middle::mir; use rustc_middle::traits; use rustc_middle::ty::fast_reject::SimplifiedType; use rustc_middle::ty::subst::{GenericArg, SubstsRef}; -use rustc_middle::ty::{self, Ty, TyCtxt}; +use rustc_middle::ty::{self, layout::TyAndLayout, Ty, TyCtxt}; use rustc_span::symbol::{Ident, Symbol}; use rustc_span::{Span, DUMMY_SP}; @@ -385,6 +385,16 @@ impl<'tcx> Key for Ty<'tcx> { } } +impl<'tcx> Key for TyAndLayout<'tcx> { + #[inline(always)] + fn query_crate_is_local(&self) -> bool { + true + } + fn default_span(&self, _: TyCtxt<'_>) -> Span { + DUMMY_SP + } +} + impl<'tcx> Key for (Ty<'tcx>, Ty<'tcx>) { #[inline(always)] fn query_crate_is_local(&self) -> bool { | 
