Move things to rustc_type_ir

This commit is contained in:
Wilco Kusee 2021-01-31 10:32:34 +01:00 committed by Michael Goulet
parent 4f39fb1f34
commit a7015fe816
25 changed files with 1030 additions and 241 deletions

View file

@ -547,12 +547,13 @@ where
value
}
impl<'a, 'tcx> TyDecoder<'tcx> for CacheDecoder<'a, 'tcx> {
impl<'a, 'tcx> TyDecoder for CacheDecoder<'a, 'tcx> {
type I = TyInterner<'tcx>;
const CLEAR_CROSS_CRATE: bool = false;
#[inline]
fn tcx(&self) -> TyCtxt<'tcx> {
self.tcx
fn interner(&self) -> TyInterner<'tcx> {
TyInterner { tcx: self.tcx }
}
#[inline]
@ -569,7 +570,7 @@ impl<'a, 'tcx> TyDecoder<'tcx> for CacheDecoder<'a, 'tcx> {
where
F: FnOnce(&mut Self) -> Ty<'tcx>,
{
let tcx = self.tcx();
let tcx = self.tcx;
let cache_key = ty::CReaderCacheKey { cnum: None, pos: shorthand };
@ -750,7 +751,7 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for DefId {
// If we get to this point, then all of the query inputs were green,
// which means that the definition with this hash is guaranteed to
// still exist in the current compilation session.
d.tcx().def_path_hash_to_def_id(def_path_hash, &mut || {
d.tcx.def_path_hash_to_def_id(def_path_hash, &mut || {
panic!("Failed to convert DefPathHash {:?}", def_path_hash)
})
}
@ -927,10 +928,11 @@ where
}
}
impl<'a, 'tcx, E> TyEncoder<'tcx> for CacheEncoder<'a, 'tcx, E>
impl<'a, 'tcx, E> TyEncoder for CacheEncoder<'a, 'tcx, E>
where
E: 'a + OpaqueEncoder,
{
type I = TyInterner<'tcx>;
const CLEAR_CROSS_CRATE: bool = false;
fn position(&self) -> usize {