@@ -113,7 +113,7 @@ fn identity(_: Ty<'_>) -> Vec<Adjustment<'_>> {
113
113
vec ! [ ]
114
114
}
115
115
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 > > {
117
117
move |target| vec ! [ Adjustment { kind, target } ]
118
118
}
119
119
@@ -484,14 +484,11 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
484
484
485
485
// Now apply the autoref. We have to extract the region out of
486
486
// the final ref type we got.
487
- let ty:: Ref ( r_borrow , _ , _ ) = ty. kind ( ) else {
487
+ let ty:: Ref ( .. ) = ty. kind ( ) else {
488
488
span_bug ! ( span, "expected a ref type, got {:?}" , ty) ;
489
489
} ;
490
490
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 } ) ;
495
492
496
493
debug ! ( "coerce_borrowed_pointer: succeeded ty={:?} adjustments={:?}" , ty, adjustments) ;
497
494
@@ -547,7 +544,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
547
544
let mutbl = AutoBorrowMutability :: new ( mutbl_b, AllowTwoPhase :: No ) ;
548
545
549
546
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) ) ,
551
548
target : Ty :: new_ref ( self . tcx , r_borrow, ty_a, mutbl_b) ,
552
549
} ) )
553
550
}
@@ -827,7 +824,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
827
824
} ;
828
825
829
826
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) ?;
831
828
832
829
coerce_mutbls ( mut_a, mut_b) ?;
833
830
@@ -841,7 +838,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
841
838
// To complete the reborrow, we need to make sure we can unify the inner types, and if so we
842
839
// add the adjustments.
843
840
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 } ]
845
842
} )
846
843
}
847
844
@@ -1321,7 +1318,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1321
1318
let noop = match self . typeck_results . borrow ( ) . expr_adjustments ( expr) {
1322
1319
& [
1323
1320
Adjustment { kind : Adjust :: Deref ( _) , .. } ,
1324
- Adjustment { kind : Adjust :: Borrow ( AutoBorrow :: Ref ( _ , mutbl_adj) ) , .. } ,
1321
+ Adjustment { kind : Adjust :: Borrow ( AutoBorrow :: Ref ( mutbl_adj) ) , .. } ,
1325
1322
] => {
1326
1323
match * self . node_ty ( expr. hir_id ) . kind ( ) {
1327
1324
ty:: Ref ( _, _, mt_orig) => {
0 commit comments