@@ -67,12 +67,11 @@ use rustc::hir::def_id::DefId;
67
67
use rustc:: infer:: { Coercion , InferOk , TypeTrace } ;
68
68
use rustc:: traits:: { self , ObligationCause , ObligationCauseCode } ;
69
69
use rustc:: ty:: adjustment:: { Adjustment , Adjust , AutoBorrow } ;
70
- use rustc:: ty:: { self , LvaluePreference , TypeVariants , TypeAndMut ,
70
+ use rustc:: ty:: { self , LvaluePreference , TypeAndMut ,
71
71
Ty , ClosureSubsts } ;
72
72
use rustc:: ty:: fold:: TypeFoldable ;
73
73
use rustc:: ty:: error:: TypeError ;
74
74
use rustc:: ty:: relate:: RelateResult ;
75
- use syntax:: ast:: NodeId ;
76
75
use syntax:: abi;
77
76
use syntax:: feature_gate;
78
77
use util:: common:: indent;
@@ -573,7 +572,7 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> {
573
572
574
573
let b = self . shallow_resolve ( b) ;
575
574
576
- let node_id_a : NodeId = self . tcx . hir . as_local_node_id ( def_id_a) . unwrap ( ) ;
575
+ let node_id_a = self . tcx . hir . as_local_node_id ( def_id_a) . unwrap ( ) ;
577
576
match b. sty {
578
577
ty:: TyFnPtr ( _) if self . tcx . with_freevars ( node_id_a, |v| v. is_empty ( ) ) => {
579
578
if !self . tcx . sess . features . borrow ( ) . closure_to_fn_coercion {
@@ -589,16 +588,16 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> {
589
588
// to
590
589
// `fn(arg0,arg1,...) -> _`
591
590
let sig = self . closure_type ( def_id_a, substs_a) . sig ;
592
- let converted_sig = sig. input ( 0 ) . map_bound ( |v | {
593
- let params_iter = match v . sty {
594
- TypeVariants :: TyTuple ( params, _) => {
591
+ let converted_sig = sig. map_bound ( |s | {
592
+ let params_iter = match s . inputs ( ) [ 0 ] . sty {
593
+ ty :: TyTuple ( params, _) => {
595
594
params. into_iter ( ) . cloned ( )
596
595
}
597
596
_ => bug ! ( ) ,
598
597
} ;
599
598
self . tcx . mk_fn_sig ( params_iter,
600
- sig . output ( ) . skip_binder ( ) ,
601
- sig . variadic ( ) )
599
+ s . output ( ) ,
600
+ s . variadic )
602
601
} ) ;
603
602
let fn_ty = self . tcx . mk_bare_fn ( ty:: BareFnTy {
604
603
unsafety : hir:: Unsafety :: Normal ,
0 commit comments