@@ -19,7 +19,6 @@ use rustc_middle::ty::{InternalSubsts, UserSubsts, UserType};
1919use rustc_span:: { Span , DUMMY_SP } ;
2020use rustc_trait_selection:: traits;
2121
22- use std:: iter;
2322use std:: ops:: Deref ;
2423
2524struct ConfirmContext < ' a , ' tcx > {
@@ -101,7 +100,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
101100 let filler_substs = rcvr_substs
102101 . extend_to ( self . tcx , pick. item . def_id , |def, _| self . tcx . mk_param_from_def ( def) ) ;
103102 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) ,
105104 ) ;
106105
107106 // Unify the (adjusted) self type with what the method expects.
@@ -565,7 +564,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
565564
566565 fn predicates_require_illegal_sized_bound (
567566 & self ,
568- predicates : & ty:: InstantiatedPredicates < ' tcx > ,
567+ predicates : ty:: InstantiatedPredicates < ' tcx > ,
569568 ) -> Option < Span > {
570569 let sized_def_id = self . tcx . lang_items ( ) . sized_trait ( ) ?;
571570
@@ -575,10 +574,11 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
575574 ty:: PredicateKind :: Clause ( ty:: Clause :: Trait ( trait_pred) )
576575 if trait_pred. def_id ( ) == sized_def_id =>
577576 {
578- let span = iter:: zip ( & predicates. predicates , & predicates. spans )
577+ let span = predicates
578+ . iter ( )
579579 . find_map (
580580 |( p, span) | {
581- if * p == obligation. predicate { Some ( * span) } else { None }
581+ if p == obligation. predicate { Some ( span) } else { None }
582582 } ,
583583 )
584584 . unwrap_or ( rustc_span:: DUMMY_SP ) ;
0 commit comments