diff options
| author | Charles Lew <crlf0710@gmail.com> | 2021-07-31 22:46:23 +0800 |
|---|---|---|
| committer | Charles Lew <crlf0710@gmail.com> | 2021-08-03 01:09:37 +0800 |
| commit | 63ed62531324cd4660deb7faff58e6c17b93b487 (patch) | |
| tree | 8e2743bf8f7a120bdff376a45e9f21d396414837 /compiler/rustc_query_impl/src/keys.rs | |
| parent | 7069a8c2b78c5d23205de1cabb4c2a65229dbd8f (diff) | |
| download | rust-63ed62531324cd4660deb7faff58e6c17b93b487.tar.gz rust-63ed62531324cd4660deb7faff58e6c17b93b487.zip | |
Implement pointer casting.
Diffstat (limited to 'compiler/rustc_query_impl/src/keys.rs')
| -rw-r--r-- | compiler/rustc_query_impl/src/keys.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_query_impl/src/keys.rs b/compiler/rustc_query_impl/src/keys.rs index 0ad360c7d89..ace7cffd16d 100644 --- a/compiler/rustc_query_impl/src/keys.rs +++ b/compiler/rustc_query_impl/src/keys.rs @@ -282,6 +282,16 @@ impl<'tcx> Key for ty::PolyTraitRef<'tcx> { } } +impl<'tcx> Key for (ty::PolyTraitRef<'tcx>, ty::PolyTraitRef<'tcx>) { + #[inline(always)] + fn query_crate_is_local(&self) -> bool { + self.0.def_id().krate == LOCAL_CRATE + } + fn default_span(&self, tcx: TyCtxt<'_>) -> Span { + tcx.def_span(self.0.def_id()) + } +} + impl<'tcx> Key for GenericArg<'tcx> { #[inline(always)] fn query_crate_is_local(&self) -> bool { |
