@@ -94,7 +94,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
94
94
match predicate. kind ( ) . skip_binder ( ) {
95
95
// For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
96
96
// and check substitutions to find `U`.
97
- ty:: PredicateKind :: Clause ( ty :: ClauseKind :: Trait ( trait_predicate) ) => {
97
+ ty:: ClauseKind :: Trait ( trait_predicate) => {
98
98
if trait_predicate
99
99
. trait_ref
100
100
. substs
@@ -107,7 +107,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
107
107
} ,
108
108
// For `impl Trait<Assoc=U>`, it will register a predicate of `<T as Trait>::Assoc = U`,
109
109
// so we check the term for `U`.
110
- ty:: PredicateKind :: Clause ( ty :: ClauseKind :: Projection ( projection_predicate) ) => {
110
+ ty:: ClauseKind :: Projection ( projection_predicate) => {
111
111
if let ty:: TermKind :: Ty ( ty) = projection_predicate. term . unpack ( ) {
112
112
if contains_ty_adt_constructor_opaque_inner ( cx, ty, needle, seen) {
113
113
return true ;
@@ -268,7 +268,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
268
268
ty:: Tuple ( substs) => substs. iter ( ) . any ( |ty| is_must_use_ty ( cx, ty) ) ,
269
269
ty:: Alias ( ty:: Opaque , ty:: AliasTy { def_id, .. } ) => {
270
270
for ( predicate, _) in cx. tcx . explicit_item_bounds ( def_id) . skip_binder ( ) {
271
- if let ty:: PredicateKind :: Clause ( ty :: ClauseKind :: Trait ( trait_predicate) ) = predicate. kind ( ) . skip_binder ( ) {
271
+ if let ty:: ClauseKind :: Trait ( trait_predicate) = predicate. kind ( ) . skip_binder ( ) {
272
272
if cx. tcx . has_attr ( trait_predicate. trait_ref . def_id , sym:: must_use) {
273
273
return true ;
274
274
}
@@ -665,7 +665,7 @@ pub fn ty_sig<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<ExprFnSig<'t
665
665
ty:: Alias ( ty:: Opaque , ty:: AliasTy { def_id, substs, .. } ) => sig_from_bounds (
666
666
cx,
667
667
ty,
668
- cx. tcx . item_bounds ( def_id) . subst ( cx. tcx , substs) ,
668
+ cx. tcx . item_bounds ( def_id) . subst_iter ( cx. tcx , substs) . map ( |c| c . as_predicate ( ) ) ,
669
669
cx. tcx . opt_parent ( def_id) ,
670
670
) ,
671
671
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
698
698
fn sig_from_bounds < ' tcx > (
699
699
cx : & LateContext < ' tcx > ,
700
700
ty : Ty < ' tcx > ,
701
- predicates : & ' tcx [ Predicate < ' tcx > ] ,
701
+ predicates : impl IntoIterator < Item = Predicate < ' tcx > > ,
702
702
predicates_id : Option < DefId > ,
703
703
) -> Option < ExprFnSig < ' tcx > > {
704
704
let mut inputs = None ;
@@ -747,7 +747,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: AliasTy<'tcx>) -> Option
747
747
. subst_iter_copied ( cx. tcx , ty. substs )
748
748
{
749
749
match pred. kind ( ) . skip_binder ( ) {
750
- PredicateKind :: Clause ( ty:: ClauseKind :: Trait ( p) )
750
+ ty:: ClauseKind :: Trait ( p)
751
751
if ( lang_items. fn_trait ( ) == Some ( p. def_id ( ) )
752
752
|| lang_items. fn_mut_trait ( ) == Some ( p. def_id ( ) )
753
753
|| lang_items. fn_once_trait ( ) == Some ( p. def_id ( ) ) ) =>
@@ -760,7 +760,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: AliasTy<'tcx>) -> Option
760
760
}
761
761
inputs = Some ( i) ;
762
762
} ,
763
- PredicateKind :: Clause ( ty:: ClauseKind :: Projection ( p) )
763
+ ty:: ClauseKind :: Projection ( p)
764
764
if Some ( p. projection_ty . def_id ) == lang_items. fn_once_output ( ) =>
765
765
{
766
766
if output. is_some ( ) {
0 commit comments