Fixed issues with incremental tests.
This commit is contained in:
parent
03481f19ea
commit
3a0162b7cb
2 changed files with 24 additions and 1 deletions
|
@ -17,6 +17,7 @@
|
|||
// persisting to incr. comp. caches.
|
||||
|
||||
use hir::def_id::{DefId, CrateNum};
|
||||
use infer::canonical::{CanonicalVarInfo, CanonicalVarInfos};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_serialize::{Decodable, Decoder, Encoder, Encodable, opaque};
|
||||
use std::hash::Hash;
|
||||
|
@ -239,6 +240,19 @@ pub fn decode_existential_predicate_slice<'a, 'tcx, D>(decoder: &mut D)
|
|||
.mk_existential_predicates((0..len).map(|_| Decodable::decode(decoder)))?)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn decode_canonical_var_infos<'a, 'tcx, D>(decoder: &mut D)
|
||||
-> Result<CanonicalVarInfos<'tcx>, D::Error>
|
||||
where D: TyDecoder<'a, 'tcx>,
|
||||
'tcx: 'a,
|
||||
{
|
||||
let len = decoder.read_usize()?;
|
||||
let interned: Result<Vec<CanonicalVarInfo>, _> = (0..len).map(|_| Decodable::decode(decoder))
|
||||
.collect();
|
||||
Ok(decoder.tcx()
|
||||
.intern_canonical_var_infos(interned?.as_slice()))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn decode_const<'a, 'tcx, D>(decoder: &mut D)
|
||||
-> Result<&'tcx ty::Const<'tcx>, D::Error>
|
||||
|
@ -262,6 +276,7 @@ macro_rules! implement_ty_decoder {
|
|||
($DecoderName:ident <$($typaram:tt),*>) => {
|
||||
mod __ty_decoder_impl {
|
||||
use super::$DecoderName;
|
||||
use $crate::infer::canonical::CanonicalVarInfos;
|
||||
use $crate::ty;
|
||||
use $crate::ty::codec::*;
|
||||
use $crate::ty::subst::Substs;
|
||||
|
@ -364,6 +379,14 @@ macro_rules! implement_ty_decoder {
|
|||
}
|
||||
}
|
||||
|
||||
impl<$($typaram),*> SpecializedDecoder<CanonicalVarInfos<'tcx>>
|
||||
for $DecoderName<$($typaram),*> {
|
||||
fn specialized_decode(&mut self)
|
||||
-> Result<CanonicalVarInfos<'tcx>, Self::Error> {
|
||||
decode_canonical_var_infos(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl<$($typaram),*> SpecializedDecoder<&'tcx $crate::ty::Const<'tcx>>
|
||||
for $DecoderName<$($typaram),*> {
|
||||
fn specialized_decode(&mut self) -> Result<&'tcx ty::Const<'tcx>, Self::Error> {
|
||||
|
|
|
@ -49,7 +49,7 @@ pub fn add_type() {
|
|||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2",
|
||||
except="HirBody,TypeckTables")]
|
||||
except="HirBody,TypeckTables,MirValidated")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
pub fn add_type() {
|
||||
let _x: u32 = 2u32;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue