@@ -664,7 +664,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
664
664
-> RelateResult < ' tcx , Ty < ' tcx > >
665
665
// FIXME(eddyb) use copyable iterators when that becomes ergonomic.
666
666
where E : Fn ( ) -> I ,
667
- I : IntoIterator < Item =( & ' b hir:: Expr , Ty < ' tcx > ) > {
667
+ I : IntoIterator < Item =& ' b hir:: Expr > {
668
668
669
669
let prev_ty = self . resolve_type_vars_with_obligations ( prev_ty) ;
670
670
let new_ty = self . resolve_type_vars_with_obligations ( new_ty) ;
@@ -703,7 +703,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
703
703
}
704
704
705
705
// Reify both sides and return the reified fn pointer type.
706
- for ( expr, _ ) in exprs ( ) . into_iter ( ) . chain ( Some ( ( new, new_ty ) ) ) {
706
+ for expr in exprs ( ) . into_iter ( ) . chain ( Some ( new) ) {
707
707
// No adjustments can produce a fn item, so this should never trip.
708
708
assert ! ( !self . tables. borrow( ) . adjustments. contains_key( & expr. id) ) ;
709
709
self . write_adjustment ( expr. id , AdjustReifyFnPointer ) ;
@@ -737,13 +737,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
737
737
// Then try to coerce the previous expressions to the type of the new one.
738
738
// This requires ensuring there are no coercions applied to *any* of the
739
739
// previous expressions, other than noop reborrows (ignoring lifetimes).
740
- for ( expr, expr_ty ) in exprs ( ) {
740
+ for expr in exprs ( ) {
741
741
let noop = match self . tables . borrow ( ) . adjustments . get ( & expr. id ) {
742
742
Some ( & AdjustDerefRef ( AutoDerefRef {
743
743
autoderefs : 1 ,
744
744
autoref : Some ( AutoPtr ( _, mutbl_adj) ) ,
745
745
unsize : None
746
- } ) ) => match expr_ty . sty {
746
+ } ) ) => match self . node_ty ( expr . id ) . sty {
747
747
ty:: TyRef ( _, mt_orig) => {
748
748
// Reborrow that we can safely ignore.
749
749
mutbl_adj == mt_orig. mutbl
@@ -767,9 +767,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
767
767
}
768
768
}
769
769
770
- match self . commit_if_ok ( |_| apply ( & mut coerce,
771
- & || exprs ( ) . into_iter ( ) . map ( |( e, _) | e) ,
772
- prev_ty, new_ty) ) {
770
+ match self . commit_if_ok ( |_| apply ( & mut coerce, & exprs, prev_ty, new_ty) ) {
773
771
Err ( _) => {
774
772
// Avoid giving strange errors on failed attempts.
775
773
if let Some ( e) = first_error {
@@ -787,7 +785,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
787
785
}
788
786
Ok ( ( ty, adjustment) ) => {
789
787
if !adjustment. is_identity ( ) {
790
- for ( expr, _ ) in exprs ( ) {
788
+ for expr in exprs ( ) {
791
789
let previous = self . tables . borrow ( ) . adjustments . get ( & expr. id ) . cloned ( ) ;
792
790
if let Some ( AdjustNeverToAny ( _) ) = previous {
793
791
self . write_adjustment ( expr. id , AdjustNeverToAny ( ty) ) ;
0 commit comments