Skip to content

Commit 3a0162b

Browse files
committed
Fixed issues with incremental tests.
1 parent 03481f1 commit 3a0162b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/librustc/ty/codec.rs

+23
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// persisting to incr. comp. caches.
1818

1919
use hir::def_id::{DefId, CrateNum};
20+
use infer::canonical::{CanonicalVarInfo, CanonicalVarInfos};
2021
use rustc_data_structures::fx::FxHashMap;
2122
use rustc_serialize::{Decodable, Decoder, Encoder, Encodable, opaque};
2223
use std::hash::Hash;
@@ -239,6 +240,19 @@ pub fn decode_existential_predicate_slice<'a, 'tcx, D>(decoder: &mut D)
239240
.mk_existential_predicates((0..len).map(|_| Decodable::decode(decoder)))?)
240241
}
241242

243+
#[inline]
244+
pub fn decode_canonical_var_infos<'a, 'tcx, D>(decoder: &mut D)
245+
-> Result<CanonicalVarInfos<'tcx>, D::Error>
246+
where D: TyDecoder<'a, 'tcx>,
247+
'tcx: 'a,
248+
{
249+
let len = decoder.read_usize()?;
250+
let interned: Result<Vec<CanonicalVarInfo>, _> = (0..len).map(|_| Decodable::decode(decoder))
251+
.collect();
252+
Ok(decoder.tcx()
253+
.intern_canonical_var_infos(interned?.as_slice()))
254+
}
255+
242256
#[inline]
243257
pub fn decode_const<'a, 'tcx, D>(decoder: &mut D)
244258
-> Result<&'tcx ty::Const<'tcx>, D::Error>
@@ -262,6 +276,7 @@ macro_rules! implement_ty_decoder {
262276
($DecoderName:ident <$($typaram:tt),*>) => {
263277
mod __ty_decoder_impl {
264278
use super::$DecoderName;
279+
use $crate::infer::canonical::CanonicalVarInfos;
265280
use $crate::ty;
266281
use $crate::ty::codec::*;
267282
use $crate::ty::subst::Substs;
@@ -364,6 +379,14 @@ macro_rules! implement_ty_decoder {
364379
}
365380
}
366381

382+
impl<$($typaram),*> SpecializedDecoder<CanonicalVarInfos<'tcx>>
383+
for $DecoderName<$($typaram),*> {
384+
fn specialized_decode(&mut self)
385+
-> Result<CanonicalVarInfos<'tcx>, Self::Error> {
386+
decode_canonical_var_infos(self)
387+
}
388+
}
389+
367390
impl<$($typaram),*> SpecializedDecoder<&'tcx $crate::ty::Const<'tcx>>
368391
for $DecoderName<$($typaram),*> {
369392
fn specialized_decode(&mut self) -> Result<&'tcx ty::Const<'tcx>, Self::Error> {

src/test/incremental/hashes/let_expressions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn add_type() {
4949

5050
#[cfg(not(cfail1))]
5151
#[rustc_clean(cfg="cfail2",
52-
except="HirBody,TypeckTables")]
52+
except="HirBody,TypeckTables,MirValidated")]
5353
#[rustc_clean(cfg="cfail3")]
5454
pub fn add_type() {
5555
let _x: u32 = 2u32;

0 commit comments

Comments
 (0)