@@ -67,12 +67,11 @@ use rustc::hir::def_id::DefId;
6767use rustc:: infer:: { Coercion , InferOk , TypeTrace } ;
6868use rustc:: traits:: { self , ObligationCause , ObligationCauseCode } ;
6969use rustc:: ty:: adjustment:: { Adjustment , Adjust , AutoBorrow } ;
70- use rustc:: ty:: { self , LvaluePreference , TypeVariants , TypeAndMut ,
70+ use rustc:: ty:: { self , LvaluePreference , TypeAndMut ,
7171 Ty , ClosureSubsts } ;
7272use rustc:: ty:: fold:: TypeFoldable ;
7373use rustc:: ty:: error:: TypeError ;
7474use rustc:: ty:: relate:: RelateResult ;
75- use syntax:: ast:: NodeId ;
7675use syntax:: abi;
7776use syntax:: feature_gate;
7877use util:: common:: indent;
@@ -573,7 +572,7 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> {
573572
574573 let b = self . shallow_resolve ( b) ;
575574
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 ( ) ;
577576 match b. sty {
578577 ty:: TyFnPtr ( _) if self . tcx . with_freevars ( node_id_a, |v| v. is_empty ( ) ) => {
579578 if !self . tcx . sess . features . borrow ( ) . closure_to_fn_coercion {
@@ -589,16 +588,16 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> {
589588 // to
590589 // `fn(arg0,arg1,...) -> _`
591590 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, _) => {
595594 params. into_iter ( ) . cloned ( )
596595 }
597596 _ => bug ! ( ) ,
598597 } ;
599598 self . tcx . mk_fn_sig ( params_iter,
600- sig . output ( ) . skip_binder ( ) ,
601- sig . variadic ( ) )
599+ s . output ( ) ,
600+ s . variadic )
602601 } ) ;
603602 let fn_ty = self . tcx . mk_bare_fn ( ty:: BareFnTy {
604603 unsafety : hir:: Unsafety :: Normal ,
0 commit comments