@@ -17,7 +17,7 @@ use rustc_lint::LateContext;
1717use rustc_middle:: mir:: interpret:: { ConstValue , Scalar } ;
1818use rustc_middle:: ty:: {
1919 self , layout:: ValidityRequirement , AdtDef , AliasTy , AssocKind , Binder , BoundRegion , FnSig , IntTy , List , ParamEnv ,
20- Predicate , PredicateKind , Region , RegionKind , SubstsRef , Ty , TyCtxt , TypeSuperVisitable , TypeVisitable ,
20+ Region , RegionKind , SubstsRef , Ty , TyCtxt , TypeSuperVisitable , TypeVisitable ,
2121 TypeVisitableExt , TypeVisitor , UintTy , VariantDef , VariantDiscr ,
2222} ;
2323use rustc_middle:: ty:: { GenericArg , GenericArgKind } ;
@@ -563,7 +563,7 @@ fn is_uninit_value_valid_for_ty_fallback<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'t
563563}
564564
565565/// Gets an iterator over all predicates which apply to the given item.
566- pub fn all_predicates_of ( tcx : TyCtxt < ' _ > , id : DefId ) -> impl Iterator < Item = & ( Predicate < ' _ > , Span ) > {
566+ pub fn all_predicates_of ( tcx : TyCtxt < ' _ > , id : DefId ) -> impl Iterator < Item = & ( ty :: Clause < ' _ > , Span ) > {
567567 let mut next_id = Some ( id) ;
568568 iter:: from_fn ( move || {
569569 next_id. take ( ) . map ( |id| {
@@ -665,7 +665,7 @@ pub fn ty_sig<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<ExprFnSig<'t
665665 ty:: Alias ( ty:: Opaque , ty:: AliasTy { def_id, substs, .. } ) => sig_from_bounds (
666666 cx,
667667 ty,
668- cx. tcx . item_bounds ( def_id) . subst_iter ( cx. tcx , substs) . map ( |c| c . as_predicate ( ) ) ,
668+ cx. tcx . item_bounds ( def_id) . subst_iter ( cx. tcx , substs) ,
669669 cx. tcx . opt_parent ( def_id) ,
670670 ) ,
671671 ty:: FnPtr ( sig) => Some ( ExprFnSig :: Sig ( sig, None ) ) ,
@@ -698,7 +698,7 @@ pub fn ty_sig<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<ExprFnSig<'t
698698fn sig_from_bounds < ' tcx > (
699699 cx : & LateContext < ' tcx > ,
700700 ty : Ty < ' tcx > ,
701- predicates : impl IntoIterator < Item = Predicate < ' tcx > > ,
701+ predicates : impl IntoIterator < Item = ty :: Clause < ' tcx > > ,
702702 predicates_id : Option < DefId > ,
703703) -> Option < ExprFnSig < ' tcx > > {
704704 let mut inputs = None ;
@@ -707,7 +707,7 @@ fn sig_from_bounds<'tcx>(
707707
708708 for pred in predicates {
709709 match pred. kind ( ) . skip_binder ( ) {
710- PredicateKind :: Clause ( ty:: ClauseKind :: Trait ( p) )
710+ ty:: ClauseKind :: Trait ( p)
711711 if ( lang_items. fn_trait ( ) == Some ( p. def_id ( ) )
712712 || lang_items. fn_mut_trait ( ) == Some ( p. def_id ( ) )
713713 || lang_items. fn_once_trait ( ) == Some ( p. def_id ( ) ) )
@@ -720,7 +720,7 @@ fn sig_from_bounds<'tcx>(
720720 }
721721 inputs = Some ( i) ;
722722 } ,
723- PredicateKind :: Clause ( ty:: ClauseKind :: Projection ( p) )
723+ ty:: ClauseKind :: Projection ( p)
724724 if Some ( p. projection_ty . def_id ) == lang_items. fn_once_output ( ) && p. projection_ty . self_ty ( ) == ty =>
725725 {
726726 if output. is_some ( ) {
@@ -937,7 +937,7 @@ pub fn adt_and_variant_of_res<'tcx>(cx: &LateContext<'tcx>, res: Res) -> Option<
937937}
938938
939939/// Checks if the type is a type parameter implementing `FnOnce`, but not `FnMut`.
940- pub fn ty_is_fn_once_param < ' tcx > ( tcx : TyCtxt < ' _ > , ty : Ty < ' tcx > , predicates : & ' tcx [ Predicate < ' _ > ] ) -> bool {
940+ pub fn ty_is_fn_once_param < ' tcx > ( tcx : TyCtxt < ' _ > , ty : Ty < ' tcx > , predicates : & ' tcx [ ty :: Clause < ' _ > ] ) -> bool {
941941 let ty:: Param ( ty) = * ty. kind ( ) else {
942942 return false ;
943943 } ;
@@ -950,7 +950,7 @@ pub fn ty_is_fn_once_param<'tcx>(tcx: TyCtxt<'_>, ty: Ty<'tcx>, predicates: &'tc
950950 predicates
951951 . iter ( )
952952 . try_fold ( false , |found, p| {
953- if let PredicateKind :: Clause ( ty:: ClauseKind :: Trait ( p) ) = p. kind ( ) . skip_binder ( )
953+ if let ty:: ClauseKind :: Trait ( p) = p. kind ( ) . skip_binder ( )
954954 && let ty:: Param ( self_ty) = p. trait_ref . self_ty ( ) . kind ( )
955955 && ty. index == self_ty. index
956956 {
0 commit comments