@@ -570,7 +570,7 @@ fn diff_traits<'tcx>(
570
570
) {
571
571
use rustc_hir:: Unsafety :: Unsafe ;
572
572
use rustc_middle:: ty:: subst:: GenericArgKind :: Type ;
573
- use rustc_middle:: ty:: { ParamTy , PredicateAtom , TyS } ;
573
+ use rustc_middle:: ty:: { ParamTy , PredicateAtom } ;
574
574
575
575
debug ! (
576
576
"diff_traits: old: {:?}, new: {:?}, output: {:?}" ,
@@ -598,12 +598,10 @@ fn diff_traits<'tcx>(
598
598
debug ! ( "trait_ref substs (old): {:?}" , trait_ref. substs) ;
599
599
600
600
if id_mapping. is_private_trait ( trait_ref. def_id ) && trait_ref. substs . len ( ) == 1 {
601
- if let Type ( & TyS {
602
- kind : TyKind :: Param ( ParamTy { index : 0 , .. } ) ,
603
- ..
604
- } ) = trait_ref. substs [ 0 ] . unpack ( )
605
- {
606
- old_sealed = true ;
601
+ if let Type ( typ) = trait_ref. substs [ 0 ] . unpack ( ) {
602
+ if let TyKind :: Param ( ParamTy { index : 0 , .. } ) = typ. kind ( ) {
603
+ old_sealed = true ;
604
+ }
607
605
}
608
606
}
609
607
}
@@ -1096,7 +1094,7 @@ fn diff_inherent_impls<'tcx>(
1096
1094
#[ allow( clippy:: match_same_arms) ]
1097
1095
fn is_impl_trait_public < ' tcx > ( tcx : TyCtxt < ' tcx > , impl_def_id : DefId ) -> bool {
1098
1096
fn type_visibility ( tcx : TyCtxt , ty : Ty ) -> Visibility {
1099
- match ty. kind {
1097
+ match ty. kind ( ) {
1100
1098
TyKind :: Adt ( def, _) => tcx. visibility ( def. did ) ,
1101
1099
1102
1100
TyKind :: Array ( t, _)
0 commit comments