diff --git a/rust-toolchain b/rust-toolchain index c89be302..641cabd5 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-08-07 +nightly-2020-09-10 diff --git a/src/mismatch.rs b/src/mismatch.rs index 2488fd80..ba9a2784 100644 --- a/src/mismatch.rs +++ b/src/mismatch.rs @@ -147,7 +147,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { self.current_new_types.insert(b); debug!("tys: mismatch relation: a: {:?}, b: {:?}", a, b); - let matching = match (&a.kind, &b.kind) { + let matching = match (a.kind(), b.kind()) { (&TyKind::Adt(a_def, a_substs), &TyKind::Adt(b_def, b_substs)) => { if self.check_substs(a_substs, b_substs) { let _ = self.relate_item_substs(a_def.did, a_substs, b_substs)?; diff --git a/src/translate.rs b/src/translate.rs index 3a95fcf7..8eb491d4 100644 --- a/src/translate.rs +++ b/src/translate.rs @@ -169,7 +169,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> { orig.fold_with(&mut BottomUpFolder { tcx: self.tcx, ty_op: |ty| { - match ty.kind { + match *ty.kind() { TyKind::Adt(&AdtDef { ref did, .. }, substs) if self.needs_translation(*did) => { @@ -559,7 +559,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> { use rustc_middle::ty::TypeAndMut; let t1 = ty.super_fold_with(self); - match t1.kind { + match *t1.kind() { TyKind::Ref(region, ty, mutbl) if region.needs_infer() => { let ty_and_mut = TypeAndMut { ty, mutbl }; self.infcx diff --git a/src/traverse.rs b/src/traverse.rs index afcbb582..50ecef5e 100644 --- a/src/traverse.rs +++ b/src/traverse.rs @@ -599,12 +599,10 @@ fn diff_traits<'tcx>( debug!("trait_ref substs (old): {:?}", trait_ref.substs); if id_mapping.is_private_trait(trait_ref.def_id) && trait_ref.substs.len() == 1 { - if let Type(&TyS { - kind: TyKind::Param(ParamTy { index: 0, .. }), - .. - }) = trait_ref.substs[0].unpack() - { - old_sealed = true; + if let Type(typ) = trait_ref.substs[0].unpack() { + if let TyKind::Param(ParamTy { index: 0, .. }) = typ.kind() { + old_sealed = true; + } } } } @@ -1097,7 +1095,7 @@ fn diff_inherent_impls<'tcx>( #[allow(clippy::match_same_arms)] fn is_impl_trait_public<'tcx>(tcx: TyCtxt<'tcx>, impl_def_id: DefId) -> bool { fn type_visibility(tcx: TyCtxt, ty: Ty) -> Visibility { - match ty.kind { + match ty.kind() { TyKind::Adt(def, _) => tcx.visibility(def.did), TyKind::Array(t, _)