Initial fixes on top of type interner commit
This commit is contained in:
parent
a7015fe816
commit
a056a953f0
28 changed files with 171 additions and 134 deletions
|
@ -27,3 +27,4 @@ rustc_ast = { path = "../rustc_ast" }
|
|||
rustc_expand = { path = "../rustc_expand" }
|
||||
rustc_span = { path = "../rustc_span" }
|
||||
rustc_session = { path = "../rustc_session" }
|
||||
rustc_type_ir = { path = "../rustc_type_ir" }
|
||||
|
|
|
@ -24,8 +24,8 @@ use rustc_middle::mir::interpret::{AllocDecodingSession, AllocDecodingState};
|
|||
use rustc_middle::thir;
|
||||
use rustc_middle::ty::codec::TyDecoder;
|
||||
use rustc_middle::ty::fast_reject::SimplifiedType;
|
||||
use rustc_middle::ty::GeneratorDiagnosticData;
|
||||
use rustc_middle::ty::{self, ParameterizedOverTcx, Ty, TyCtxt, Visibility};
|
||||
use rustc_middle::ty::{GeneratorDiagnosticData, TyInterner};
|
||||
use rustc_serialize::{opaque, Decodable, Decoder};
|
||||
use rustc_session::cstore::{
|
||||
CrateSource, ExternCrate, ForeignModule, LinkagePreference, NativeLib,
|
||||
|
@ -377,12 +377,13 @@ impl<'a, 'tcx> DecodeContext<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> TyDecoder<'tcx> for DecodeContext<'a, 'tcx> {
|
||||
impl<'a, 'tcx> TyDecoder for DecodeContext<'a, 'tcx> {
|
||||
const CLEAR_CROSS_CRATE: bool = true;
|
||||
|
||||
#[inline]
|
||||
fn tcx(&self) -> TyCtxt<'tcx> {
|
||||
self.tcx.expect("missing TyCtxt in DecodeContext")
|
||||
type I = TyInterner<'tcx>;
|
||||
|
||||
fn interner(&self) -> Self::I {
|
||||
TyInterner { tcx: self.tcx() }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
@ -26,7 +26,7 @@ use rustc_middle::traits::specialization_graph;
|
|||
use rustc_middle::ty::codec::TyEncoder;
|
||||
use rustc_middle::ty::fast_reject::{self, SimplifiedType, TreatParams};
|
||||
use rustc_middle::ty::query::Providers;
|
||||
use rustc_middle::ty::{self, SymbolName, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{self, SymbolName, Ty, TyCtxt, TyInterner};
|
||||
use rustc_serialize::{opaque, Encodable, Encoder};
|
||||
use rustc_session::config::CrateType;
|
||||
use rustc_session::cstore::{ForeignModule, LinkagePreference, NativeLib};
|
||||
|
@ -313,9 +313,11 @@ impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for Span {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> TyEncoder<'tcx> for EncodeContext<'a, 'tcx> {
|
||||
impl<'a, 'tcx> TyEncoder for EncodeContext<'a, 'tcx> {
|
||||
const CLEAR_CROSS_CRATE: bool = true;
|
||||
|
||||
type I = TyInterner<'tcx>;
|
||||
|
||||
fn position(&self) -> usize {
|
||||
self.opaque.position()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue