@@ -2359,8 +2359,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
23592359 // If a closure captured our `target` and then assigned
23602360 // into a place then we should annotate the closure in
23612361 // 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+ ) ;
23642366 debug ! (
23652367 "annotate_argument_and_return_for_borrow: \
23662368 annotated_closure={:?} assigned_from_local={:?} \
@@ -2483,7 +2485,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
24832485 fn annotate_fn_sig (
24842486 & self ,
24852487 did : LocalDefId ,
2486- sig : ty:: PolyFnSig < ' tcx > ,
2488+ sig : ty:: FnSig < ' tcx > ,
24872489 ) -> Option < AnnotatedBorrowFnSignature < ' tcx > > {
24882490 debug ! ( "annotate_fn_sig: did={:?} sig={:?}" , did, sig) ;
24892491 let is_closure = self . infcx . tcx . is_closure ( did. to_def_id ( ) ) ;
@@ -2513,12 +2515,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
25132515 // 3. The return type is not a reference. In this case, we don't highlight
25142516 // anything.
25152517 let return_ty = sig. output ( ) ;
2516- match return_ty. skip_binder ( ) . kind ( ) {
2518+ match return_ty. kind ( ) {
25172519 ty:: Ref ( return_region, _, _) if return_region. has_name ( ) && !is_closure => {
25182520 // This is case 1 from above, return type is a named reference so we need to
25192521 // search for relevant arguments.
25202522 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 ( ) {
25222524 if let ty:: Ref ( argument_region, _, _) = argument. kind ( ) {
25232525 if argument_region == return_region {
25242526 // Need to use the `rustc_middle::ty` types to compare against the
@@ -2542,7 +2544,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
25422544
25432545 // We use a mix of the HIR and the Ty types to get information
25442546 // 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 ( ) ;
25462548 let mut return_span = fn_decl. output . span ( ) ;
25472549 if let hir:: FnRetTy :: Return ( ty) = & fn_decl. output {
25482550 if let hir:: TyKind :: Rptr ( lifetime, _) = ty. kind {
@@ -2561,7 +2563,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
25612563 // reference so we select
25622564 // the first argument.
25632565 let argument_span = fn_decl. inputs . first ( ) ?. span ;
2564- let argument_ty = sig. inputs ( ) . skip_binder ( ) . first ( ) ?;
2566+ let argument_ty = sig. inputs ( ) . first ( ) ?;
25652567
25662568 // Closure arguments are wrapped in a tuple, so we need to get the first
25672569 // from that.
@@ -2581,10 +2583,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
25812583 // This is also case 2 from above but for functions, return type is still an
25822584 // anonymous reference so we select the first argument.
25832585 let argument_span = fn_decl. inputs . first ( ) ?. span ;
2584- let argument_ty = * sig. inputs ( ) . skip_binder ( ) . first ( ) ?;
2586+ let argument_ty = * sig. inputs ( ) . first ( ) ?;
25852587
25862588 let return_span = fn_decl. output . span ( ) ;
2587- let return_ty = sig. output ( ) . skip_binder ( ) ;
2589+ let return_ty = sig. output ( ) ;
25882590
25892591 // We expect the first argument to be a reference.
25902592 match argument_ty. kind ( ) {
0 commit comments