From 0c23bf019e4dfdcba4002215b6d67017ad2cfbb8 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Tue, 17 Nov 2020 18:09:03 +0100 Subject: [PATCH] Fix breakage due to rust-lang/rust#73705 --- rust-toolchain | 2 +- src/mismatch.rs | 32 ++++++++++++++++---------------- src/translate.rs | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 39968240..76dc5a3e 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-06-23 +nightly-2020-07-07 diff --git a/src/mismatch.rs b/src/mismatch.rs index d712ca37..2488fd80 100644 --- a/src/mismatch.rs +++ b/src/mismatch.rs @@ -79,7 +79,7 @@ impl<'a, 'tcx> MismatchRelation<'a, 'tcx> { let old_ty = self.tcx.type_of(old_def_id); let new_ty = self.tcx.type_of(new_def_id); debug!("relating item pair"); - let _ = self.relate(&old_ty, &new_ty); + let _ = self.relate(old_ty, new_ty); } } @@ -118,13 +118,13 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { fn relate_with_variance>( &mut self, _: ty::Variance, - a: &T, - b: &T, + a: T, + b: T, ) -> RelateResult<'tcx, T> { self.relate(a, b) } - fn relate>(&mut self, a: &T, b: &T) -> RelateResult<'tcx, T> { + fn relate>(&mut self, a: T, b: T) -> RelateResult<'tcx, T> { debug!("relate: mismatch relation: a: {:?}, b: {:?}", a, b); Relate::relate(self, a, b) } @@ -166,7 +166,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { { let b_field_ty = b_field.ty(self.tcx, b_substs); - let _ = self.relate(&a_field_ty, &b_field_ty)?; + let _ = self.relate(a_field_ty, b_field_ty)?; } } @@ -193,16 +193,16 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { } (&TyKind::Array(a_t, _), &TyKind::Array(b_t, _)) | (&TyKind::Slice(a_t), &TyKind::Slice(b_t)) => { - let _ = self.relate(&a_t, &b_t)?; + let _ = self.relate(a_t, b_t)?; None } (&TyKind::RawPtr(a_mt), &TyKind::RawPtr(b_mt)) => { - let _ = self.relate(&a_mt, &b_mt)?; + let _ = self.relate(a_mt, b_mt)?; None } (&TyKind::Ref(a_r, a_ty, _), &TyKind::Ref(b_r, b_ty, _)) => { - let _ = self.relate(&a_r, &b_r)?; - let _ = self.relate(&a_ty, &b_ty)?; + let _ = self.relate(a_r, b_r)?; + let _ = self.relate(a_ty, b_ty)?; None } (&TyKind::FnDef(a_def_id, a_substs), &TyKind::FnDef(b_def_id, b_substs)) => { @@ -219,17 +219,17 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { Some((a, b)) } (&TyKind::FnPtr(a_fty), &TyKind::FnPtr(b_fty)) => { - let _ = self.relate(&a_fty, &b_fty)?; + let _ = self.relate(a_fty, b_fty)?; None } (&TyKind::Dynamic(a_obj, a_r), &TyKind::Dynamic(b_obj, b_r)) => { - let _ = self.relate(&a_r, &b_r)?; + let _ = self.relate(a_r, b_r)?; let a = a_obj.principal(); let b = b_obj.principal(); if let (Some(a), Some(b)) = (a, b) { if self.check_substs(a.skip_binder().substs, b.skip_binder().substs) { - let _ = self.relate(&a.skip_binder().substs, &b.skip_binder().substs)?; + let _ = self.relate(a.skip_binder().substs, b.skip_binder().substs)?; let a = Res::Def(DefKind::Trait, a.skip_binder().def_id); let b = Res::Def(DefKind::Trait, b.skip_binder().def_id); Some((a, b)) @@ -241,11 +241,11 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { } } (&TyKind::Tuple(as_), &TyKind::Tuple(bs)) => { - let _ = as_.iter().zip(bs).map(|(a, b)| self.relate(&a, &b)); + let _ = as_.iter().zip(bs).map(|(a, b)| self.relate(a, b)); None } (&TyKind::Projection(a_data), &TyKind::Projection(b_data)) => { - let _ = self.relate(&a_data, &b_data)?; + let _ = self.relate(a_data, b_data)?; let a = Res::Def(DefKind::AssocTy, a_data.item_def_id); let b = Res::Def(DefKind::AssocTy, b_data.item_def_id); @@ -305,8 +305,8 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { fn binders>( &mut self, - a: &ty::Binder, - b: &ty::Binder, + a: ty::Binder, + b: ty::Binder, ) -> RelateResult<'tcx, ty::Binder> { Ok(ty::Binder::bind( self.relate(a.skip_binder(), b.skip_binder())?, diff --git a/src/translate.rs b/src/translate.rs index 70c7fde7..008ff4b0 100644 --- a/src/translate.rs +++ b/src/translate.rs @@ -211,7 +211,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> { let res: Vec<_> = preds .iter() .map(|p| { - match *p.skip_binder() { + match p.skip_binder() { Trait(existential_trait_ref) => { let trait_ref = Binder::bind(existential_trait_ref) .with_self_ty(self.tcx, dummy_self);