@@ -81,7 +81,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
8181 match predicate. kind ( ) . skip_binder ( ) {
8282 // For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
8383 // and check substituions to find `U`.
84- ty:: PredicateKind :: Trait ( trait_predicate) => {
84+ ty:: PredicateKind :: Clause ( ty :: Clause :: Trait ( trait_predicate) ) => {
8585 if trait_predicate
8686 . trait_ref
8787 . substs
@@ -94,7 +94,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
9494 } ,
9595 // For `impl Trait<Assoc=U>`, it will register a predicate of `<T as Trait>::Assoc = U`,
9696 // so we check the term for `U`.
97- ty:: PredicateKind :: Projection ( projection_predicate) => {
97+ ty:: PredicateKind :: Clause ( ty :: Clause :: Projection ( projection_predicate) ) => {
9898 if let ty:: TermKind :: Ty ( ty) = projection_predicate. term . unpack ( ) {
9999 if contains_ty_adt_constructor_opaque ( cx, ty, needle) {
100100 return true ;
@@ -239,7 +239,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
239239 ty:: Tuple ( substs) => substs. iter ( ) . any ( |ty| is_must_use_ty ( cx, ty) ) ,
240240 ty:: Opaque ( def_id, _) => {
241241 for ( predicate, _) in cx. tcx . explicit_item_bounds ( * def_id) {
242- if let ty:: PredicateKind :: Trait ( trait_predicate) = predicate. kind ( ) . skip_binder ( ) {
242+ if let ty:: PredicateKind :: Clause ( ty :: Clause :: Trait ( trait_predicate) ) = predicate. kind ( ) . skip_binder ( ) {
243243 if cx. tcx . has_attr ( trait_predicate. trait_ref . def_id , sym:: must_use) {
244244 return true ;
245245 }
@@ -658,7 +658,7 @@ fn sig_from_bounds<'tcx>(
658658
659659 for pred in predicates {
660660 match pred. kind ( ) . skip_binder ( ) {
661- PredicateKind :: Trait ( p)
661+ PredicateKind :: Clause ( ty :: Clause :: Trait ( p) )
662662 if ( lang_items. fn_trait ( ) == Some ( p. def_id ( ) )
663663 || lang_items. fn_mut_trait ( ) == Some ( p. def_id ( ) )
664664 || lang_items. fn_once_trait ( ) == Some ( p. def_id ( ) ) )
@@ -671,7 +671,7 @@ fn sig_from_bounds<'tcx>(
671671 }
672672 inputs = Some ( i) ;
673673 } ,
674- PredicateKind :: Projection ( p)
674+ PredicateKind :: Clause ( ty :: Clause :: Projection ( p) )
675675 if Some ( p. projection_ty . item_def_id ) == lang_items. fn_once_output ( )
676676 && p. projection_ty . self_ty ( ) == ty =>
677677 {
@@ -699,7 +699,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: ProjectionTy<'tcx>) -> O
699699 . subst_iter_copied ( cx. tcx , ty. substs )
700700 {
701701 match pred. kind ( ) . skip_binder ( ) {
702- PredicateKind :: Trait ( p)
702+ PredicateKind :: Clause ( ty :: Clause :: Trait ( p) )
703703 if ( lang_items. fn_trait ( ) == Some ( p. def_id ( ) )
704704 || lang_items. fn_mut_trait ( ) == Some ( p. def_id ( ) )
705705 || lang_items. fn_once_trait ( ) == Some ( p. def_id ( ) ) ) =>
@@ -712,7 +712,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: ProjectionTy<'tcx>) -> O
712712 }
713713 inputs = Some ( i) ;
714714 } ,
715- PredicateKind :: Projection ( p) if Some ( p. projection_ty . item_def_id ) == lang_items. fn_once_output ( ) => {
715+ PredicateKind :: Clause ( ty :: Clause :: Projection ( p) ) if Some ( p. projection_ty . item_def_id ) == lang_items. fn_once_output ( ) => {
716716 if output. is_some ( ) {
717717 // Multiple different fn trait impls. Is this even allowed?
718718 return None ;
@@ -887,7 +887,7 @@ pub fn ty_is_fn_once_param<'tcx>(tcx: TyCtxt<'_>, ty: Ty<'tcx>, predicates: &'tc
887887 predicates
888888 . iter ( )
889889 . try_fold ( false , |found, p| {
890- if let PredicateKind :: Trait ( p) = p. kind ( ) . skip_binder ( )
890+ if let PredicateKind :: Clause ( ty :: Clause :: Trait ( p) ) = p. kind ( ) . skip_binder ( )
891891 && let ty:: Param ( self_ty) = p. trait_ref . self_ty ( ) . kind ( )
892892 && ty. index == self_ty. index
893893 {
0 commit comments