@@ -81,7 +81,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
81
81
match predicate. kind ( ) . skip_binder ( ) {
82
82
// For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
83
83
// and check substituions to find `U`.
84
- ty:: PredicateKind :: Trait ( trait_predicate) => {
84
+ ty:: PredicateKind :: Clause ( ty :: Clause :: Trait ( trait_predicate) ) => {
85
85
if trait_predicate
86
86
. trait_ref
87
87
. substs
@@ -94,7 +94,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
94
94
} ,
95
95
// For `impl Trait<Assoc=U>`, it will register a predicate of `<T as Trait>::Assoc = U`,
96
96
// so we check the term for `U`.
97
- ty:: PredicateKind :: Projection ( projection_predicate) => {
97
+ ty:: PredicateKind :: Clause ( ty :: Clause :: Projection ( projection_predicate) ) => {
98
98
if let ty:: TermKind :: Ty ( ty) = projection_predicate. term . unpack ( ) {
99
99
if contains_ty_adt_constructor_opaque ( cx, ty, needle) {
100
100
return true ;
@@ -239,7 +239,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
239
239
ty:: Tuple ( substs) => substs. iter ( ) . any ( |ty| is_must_use_ty ( cx, ty) ) ,
240
240
ty:: Opaque ( def_id, _) => {
241
241
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 ( ) {
243
243
if cx. tcx . has_attr ( trait_predicate. trait_ref . def_id , sym:: must_use) {
244
244
return true ;
245
245
}
@@ -658,7 +658,7 @@ fn sig_from_bounds<'tcx>(
658
658
659
659
for pred in predicates {
660
660
match pred. kind ( ) . skip_binder ( ) {
661
- PredicateKind :: Trait ( p)
661
+ PredicateKind :: Clause ( ty :: Clause :: Trait ( p) )
662
662
if ( lang_items. fn_trait ( ) == Some ( p. def_id ( ) )
663
663
|| lang_items. fn_mut_trait ( ) == Some ( p. def_id ( ) )
664
664
|| lang_items. fn_once_trait ( ) == Some ( p. def_id ( ) ) )
@@ -671,7 +671,7 @@ fn sig_from_bounds<'tcx>(
671
671
}
672
672
inputs = Some ( i) ;
673
673
} ,
674
- PredicateKind :: Projection ( p)
674
+ PredicateKind :: Clause ( ty :: Clause :: Projection ( p) )
675
675
if Some ( p. projection_ty . item_def_id ) == lang_items. fn_once_output ( )
676
676
&& p. projection_ty . self_ty ( ) == ty =>
677
677
{
@@ -699,7 +699,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: ProjectionTy<'tcx>) -> O
699
699
. subst_iter_copied ( cx. tcx , ty. substs )
700
700
{
701
701
match pred. kind ( ) . skip_binder ( ) {
702
- PredicateKind :: Trait ( p)
702
+ PredicateKind :: Clause ( ty :: Clause :: Trait ( p) )
703
703
if ( lang_items. fn_trait ( ) == Some ( p. def_id ( ) )
704
704
|| lang_items. fn_mut_trait ( ) == Some ( p. def_id ( ) )
705
705
|| 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
712
712
}
713
713
inputs = Some ( i) ;
714
714
} ,
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 ( ) => {
716
716
if output. is_some ( ) {
717
717
// Multiple different fn trait impls. Is this even allowed?
718
718
return None ;
@@ -887,7 +887,7 @@ pub fn ty_is_fn_once_param<'tcx>(tcx: TyCtxt<'_>, ty: Ty<'tcx>, predicates: &'tc
887
887
predicates
888
888
. iter ( )
889
889
. 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 ( )
891
891
&& let ty:: Param ( self_ty) = p. trait_ref . self_ty ( ) . kind ( )
892
892
&& ty. index == self_ty. index
893
893
{
0 commit comments