Skip to content

Commit 551fd4b

Browse files
committed
Fix breakage due to rust-lang/rust#70551
1 parent b9d358f commit 551fd4b

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2020-06-16
1+
nightly-2020-06-23

src/mismatch.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
135135
use rustc_middle::ty::TyKind;
136136

137137
if self.current_old_types.contains(a) || self.current_new_types.contains(b) {
138-
return Ok(self.tcx.types.err);
138+
return Ok(self.tcx.types.unit);
139139
}
140140

141141
self.current_old_types.insert(a);
@@ -279,7 +279,10 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
279279
}
280280
}
281281

282-
Ok(self.tcx.types.err)
282+
// FIXME: This used to be a ty_error() placeholder type since this pass
283+
// doesn't really relate but is effectful and collects matching items,
284+
// therefore it seems it shouldn't matter what we return here
285+
Ok(self.tcx.types.unit)
283286
}
284287

285288
fn regions(

src/translate.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,17 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
204204

205205
let success = Cell::new(true);
206206
let err_pred = AutoTrait(DefId::local(CRATE_DEF_INDEX));
207+
// A `Self` within original bounds are to be substituted
208+
// with a `trait_object_dummy_self`.
209+
let dummy_self = self.tcx.types.trait_object_dummy_self;
207210

208211
let res: Vec<_> = preds
209212
.iter()
210213
.map(|p| {
211214
match *p.skip_binder() {
212215
Trait(existential_trait_ref) => {
213216
let trait_ref = Binder::bind(existential_trait_ref)
214-
.with_self_ty(self.tcx, self.tcx.types.err);
217+
.with_self_ty(self.tcx, dummy_self);
215218
let did = trait_ref.skip_binder().def_id;
216219
let substs = trait_ref.skip_binder().substs;
217220

@@ -234,7 +237,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
234237
}
235238
Projection(existential_projection) => {
236239
let projection_pred = Binder::bind(existential_projection)
237-
.with_self_ty(self.tcx, self.tcx.types.err);
240+
.with_self_ty(self.tcx, dummy_self);
238241
let item_def_id =
239242
projection_pred.skip_binder().projection_ty.item_def_id;
240243
let substs =
@@ -561,7 +564,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
561564
.tcx
562565
.mk_ref(self.infcx.tcx.lifetimes.re_erased, ty_and_mut)
563566
}
564-
TyKind::Infer(_) => self.infcx.tcx.mk_ty(TyKind::Error),
567+
TyKind::Infer(_) => self.infcx.tcx.ty_error(),
565568
_ => t1,
566569
}
567570
}

0 commit comments

Comments
 (0)