@@ -2359,8 +2359,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
2359
2359
// If a closure captured our `target` and then assigned
2360
2360
// into a place then we should annotate the closure in
2361
2361
// case it ends up being assigned into the return place.
2362
- annotated_closure =
2363
- self . annotate_fn_sig ( def_id, substs. as_closure ( ) . sig ( ) ) ;
2362
+ annotated_closure = self . annotate_fn_sig (
2363
+ def_id,
2364
+ substs. as_closure ( ) . sig ( ) . skip_binder ( ) ,
2365
+ ) ;
2364
2366
debug ! (
2365
2367
"annotate_argument_and_return_for_borrow: \
2366
2368
annotated_closure={:?} assigned_from_local={:?} \
@@ -2483,7 +2485,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
2483
2485
fn annotate_fn_sig (
2484
2486
& self ,
2485
2487
did : LocalDefId ,
2486
- sig : ty:: PolyFnSig < ' tcx > ,
2488
+ sig : ty:: FnSig < ' tcx > ,
2487
2489
) -> Option < AnnotatedBorrowFnSignature < ' tcx > > {
2488
2490
debug ! ( "annotate_fn_sig: did={:?} sig={:?}" , did, sig) ;
2489
2491
let is_closure = self . infcx . tcx . is_closure ( did. to_def_id ( ) ) ;
@@ -2513,12 +2515,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
2513
2515
// 3. The return type is not a reference. In this case, we don't highlight
2514
2516
// anything.
2515
2517
let return_ty = sig. output ( ) ;
2516
- match return_ty. skip_binder ( ) . kind ( ) {
2518
+ match return_ty. kind ( ) {
2517
2519
ty:: Ref ( return_region, _, _) if return_region. has_name ( ) && !is_closure => {
2518
2520
// This is case 1 from above, return type is a named reference so we need to
2519
2521
// search for relevant arguments.
2520
2522
let mut arguments = Vec :: new ( ) ;
2521
- for ( index, argument) in sig. inputs ( ) . skip_binder ( ) . iter ( ) . enumerate ( ) {
2523
+ for ( index, argument) in sig. inputs ( ) . iter ( ) . enumerate ( ) {
2522
2524
if let ty:: Ref ( argument_region, _, _) = argument. kind ( ) {
2523
2525
if argument_region == return_region {
2524
2526
// Need to use the `rustc_middle::ty` types to compare against the
@@ -2542,7 +2544,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
2542
2544
2543
2545
// We use a mix of the HIR and the Ty types to get information
2544
2546
// as the HIR doesn't have full types for closure arguments.
2545
- let return_ty = sig. output ( ) . skip_binder ( ) ;
2547
+ let return_ty = sig. output ( ) ;
2546
2548
let mut return_span = fn_decl. output . span ( ) ;
2547
2549
if let hir:: FnRetTy :: Return ( ty) = & fn_decl. output {
2548
2550
if let hir:: TyKind :: Rptr ( lifetime, _) = ty. kind {
@@ -2561,7 +2563,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
2561
2563
// reference so we select
2562
2564
// the first argument.
2563
2565
let argument_span = fn_decl. inputs . first ( ) ?. span ;
2564
- let argument_ty = sig. inputs ( ) . skip_binder ( ) . first ( ) ?;
2566
+ let argument_ty = sig. inputs ( ) . first ( ) ?;
2565
2567
2566
2568
// Closure arguments are wrapped in a tuple, so we need to get the first
2567
2569
// from that.
@@ -2581,10 +2583,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
2581
2583
// This is also case 2 from above but for functions, return type is still an
2582
2584
// anonymous reference so we select the first argument.
2583
2585
let argument_span = fn_decl. inputs . first ( ) ?. span ;
2584
- let argument_ty = * sig. inputs ( ) . skip_binder ( ) . first ( ) ?;
2586
+ let argument_ty = * sig. inputs ( ) . first ( ) ?;
2585
2587
2586
2588
let return_span = fn_decl. output . span ( ) ;
2587
- let return_ty = sig. output ( ) . skip_binder ( ) ;
2589
+ let return_ty = sig. output ( ) ;
2588
2590
2589
2591
// We expect the first argument to be a reference.
2590
2592
match argument_ty. kind ( ) {
0 commit comments