@@ -19,7 +19,6 @@ use rustc_middle::ty::{InternalSubsts, UserSubsts, UserType};
19
19
use rustc_span:: { Span , DUMMY_SP } ;
20
20
use rustc_trait_selection:: traits;
21
21
22
- use std:: iter;
23
22
use std:: ops:: Deref ;
24
23
25
24
struct ConfirmContext < ' a , ' tcx > {
@@ -101,7 +100,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
101
100
let filler_substs = rcvr_substs
102
101
. extend_to ( self . tcx , pick. item . def_id , |def, _| self . tcx . mk_param_from_def ( def) ) ;
103
102
let illegal_sized_bound = self . predicates_require_illegal_sized_bound (
104
- & self . tcx . predicates_of ( pick. item . def_id ) . instantiate ( self . tcx , filler_substs) ,
103
+ self . tcx . predicates_of ( pick. item . def_id ) . instantiate ( self . tcx , filler_substs) ,
105
104
) ;
106
105
107
106
// Unify the (adjusted) self type with what the method expects.
@@ -565,7 +564,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
565
564
566
565
fn predicates_require_illegal_sized_bound (
567
566
& self ,
568
- predicates : & ty:: InstantiatedPredicates < ' tcx > ,
567
+ predicates : ty:: InstantiatedPredicates < ' tcx > ,
569
568
) -> Option < Span > {
570
569
let sized_def_id = self . tcx . lang_items ( ) . sized_trait ( ) ?;
571
570
@@ -575,10 +574,11 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
575
574
ty:: PredicateKind :: Clause ( ty:: Clause :: Trait ( trait_pred) )
576
575
if trait_pred. def_id ( ) == sized_def_id =>
577
576
{
578
- let span = iter:: zip ( & predicates. predicates , & predicates. spans )
577
+ let span = predicates
578
+ . iter ( )
579
579
. find_map (
580
580
|( p, span) | {
581
- if * p == obligation. predicate { Some ( * span) } else { None }
581
+ if p == obligation. predicate { Some ( span) } else { None }
582
582
} ,
583
583
)
584
584
. unwrap_or ( rustc_span:: DUMMY_SP ) ;
0 commit comments