@@ -113,7 +113,7 @@ fn identity(_: Ty<'_>) -> Vec<Adjustment<'_>> {
113113 vec ! [ ]
114114}
115115
116- fn simple < ' tcx > ( kind : Adjust < ' tcx > ) -> impl FnOnce ( Ty < ' tcx > ) -> Vec < Adjustment < ' tcx > > {
116+ fn simple < ' tcx > ( kind : Adjust ) -> impl FnOnce ( Ty < ' tcx > ) -> Vec < Adjustment < ' tcx > > {
117117 move |target| vec ! [ Adjustment { kind, target } ]
118118}
119119
@@ -484,14 +484,11 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
484484
485485 // Now apply the autoref. We have to extract the region out of
486486 // the final ref type we got.
487- let ty:: Ref ( r_borrow , _ , _ ) = ty. kind ( ) else {
487+ let ty:: Ref ( .. ) = ty. kind ( ) else {
488488 span_bug ! ( span, "expected a ref type, got {:?}" , ty) ;
489489 } ;
490490 let mutbl = AutoBorrowMutability :: new ( mutbl_b, self . allow_two_phase ) ;
491- adjustments. push ( Adjustment {
492- kind : Adjust :: Borrow ( AutoBorrow :: Ref ( * r_borrow, mutbl) ) ,
493- target : ty,
494- } ) ;
491+ adjustments. push ( Adjustment { kind : Adjust :: Borrow ( AutoBorrow :: Ref ( mutbl) ) , target : ty } ) ;
495492
496493 debug ! ( "coerce_borrowed_pointer: succeeded ty={:?} adjustments={:?}" , ty, adjustments) ;
497494
@@ -547,7 +544,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
547544 let mutbl = AutoBorrowMutability :: new ( mutbl_b, AllowTwoPhase :: No ) ;
548545
549546 Some ( ( Adjustment { kind : Adjust :: Deref ( None ) , target : ty_a } , Adjustment {
550- kind : Adjust :: Borrow ( AutoBorrow :: Ref ( r_borrow , mutbl) ) ,
547+ kind : Adjust :: Borrow ( AutoBorrow :: Ref ( mutbl) ) ,
551548 target : Ty :: new_ref ( self . tcx , r_borrow, ty_a, mutbl_b) ,
552549 } ) )
553550 }
@@ -827,7 +824,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
827824 } ;
828825
829826 let ( pin, a_region, a_ty, mut_a) = extract_pin_mut ( a) ?;
830- let ( _, b_region , _b_ty, mut_b) = extract_pin_mut ( b) ?;
827+ let ( _, _ , _b_ty, mut_b) = extract_pin_mut ( b) ?;
831828
832829 coerce_mutbls ( mut_a, mut_b) ?;
833830
@@ -841,7 +838,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
841838 // To complete the reborrow, we need to make sure we can unify the inner types, and if so we
842839 // add the adjustments.
843840 self . unify_and ( a, b, |_inner_ty| {
844- vec ! [ Adjustment { kind: Adjust :: ReborrowPin ( b_region , mut_b) , target: b } ]
841+ vec ! [ Adjustment { kind: Adjust :: ReborrowPin ( mut_b) , target: b } ]
845842 } )
846843 }
847844
@@ -1321,7 +1318,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13211318 let noop = match self . typeck_results . borrow ( ) . expr_adjustments ( expr) {
13221319 & [
13231320 Adjustment { kind : Adjust :: Deref ( _) , .. } ,
1324- Adjustment { kind : Adjust :: Borrow ( AutoBorrow :: Ref ( _ , mutbl_adj) ) , .. } ,
1321+ Adjustment { kind : Adjust :: Borrow ( AutoBorrow :: Ref ( mutbl_adj) ) , .. } ,
13251322 ] => {
13261323 match * self . node_ty ( expr. hir_id ) . kind ( ) {
13271324 ty:: Ref ( _, _, mt_orig) => {
0 commit comments