Skip to content

Commit

Permalink
Fix breakage due to rust-lang/rust#75077
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Nov 19, 2020
1 parent 4e57532 commit ab23df5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2020-08-07
nightly-2020-09-10
2 changes: 1 addition & 1 deletion src/mismatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
4 changes: 2 additions & 2 deletions src/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
{
Expand Down Expand Up @@ -553,7 +553,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
Expand Down
14 changes: 6 additions & 8 deletions src/traverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ fn diff_traits<'tcx>(
) {
use rustc_hir::Unsafety::Unsafe;
use rustc_middle::ty::subst::GenericArgKind::Type;
use rustc_middle::ty::{ParamTy, PredicateAtom, TyS};
use rustc_middle::ty::{ParamTy, PredicateAtom};

debug!(
"diff_traits: old: {:?}, new: {:?}, output: {:?}",
Expand Down Expand Up @@ -598,12 +598,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;
}
}
}
}
Expand Down Expand Up @@ -1096,7 +1094,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, _)
Expand Down

0 comments on commit ab23df5

Please sign in to comment.