@@ -42,8 +42,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
42
42
) -> Ty < ' tcx > {
43
43
debug ! (
44
44
"check_expr_closure(expr={:?},expected={:?})" ,
45
- expr,
46
- expected
45
+ expr, expected
47
46
) ;
48
47
49
48
// It's always helpful for inference if we know the kind of
@@ -68,8 +67,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
68
67
) -> Ty < ' tcx > {
69
68
debug ! (
70
69
"check_closure(opt_kind={:?}, expected_sig={:?})" ,
71
- opt_kind,
72
- expected_sig
70
+ opt_kind, expected_sig
73
71
) ;
74
72
75
73
let expr_def_id = self . tcx . hir . local_def_id ( expr. id ) ;
@@ -109,19 +107,22 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
109
107
let closure_type = self . tcx . mk_closure ( expr_def_id, substs) ;
110
108
111
109
if let Some ( GeneratorTypes { yield_ty, interior } ) = generator_types {
112
- self . demand_eqtype ( expr. span ,
113
- yield_ty,
114
- substs. generator_yield_ty ( expr_def_id, self . tcx ) ) ;
115
- self . demand_eqtype ( expr. span ,
116
- liberated_sig. output ( ) ,
117
- substs. generator_return_ty ( expr_def_id, self . tcx ) ) ;
110
+ self . demand_eqtype (
111
+ expr. span ,
112
+ yield_ty,
113
+ substs. generator_yield_ty ( expr_def_id, self . tcx ) ,
114
+ ) ;
115
+ self . demand_eqtype (
116
+ expr. span ,
117
+ liberated_sig. output ( ) ,
118
+ substs. generator_return_ty ( expr_def_id, self . tcx ) ,
119
+ ) ;
118
120
return self . tcx . mk_generator ( expr_def_id, substs, interior) ;
119
121
}
120
122
121
123
debug ! (
122
124
"check_closure: expr.id={:?} closure_type={:?}" ,
123
- expr. id,
124
- closure_type
125
+ expr. id, closure_type
125
126
) ;
126
127
127
128
// Tuple up the arguments and insert the resulting function type into
@@ -138,20 +139,22 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
138
139
139
140
debug ! (
140
141
"check_closure: expr_def_id={:?}, sig={:?}, opt_kind={:?}" ,
141
- expr_def_id,
142
- sig,
143
- opt_kind
142
+ expr_def_id, sig, opt_kind
144
143
) ;
145
144
146
145
let sig_fn_ptr_ty = self . tcx . mk_fn_ptr ( sig) ;
147
- self . demand_eqtype ( expr. span ,
148
- sig_fn_ptr_ty,
149
- substs. closure_sig_ty ( expr_def_id, self . tcx ) ) ;
146
+ self . demand_eqtype (
147
+ expr. span ,
148
+ sig_fn_ptr_ty,
149
+ substs. closure_sig_ty ( expr_def_id, self . tcx ) ,
150
+ ) ;
150
151
151
152
if let Some ( kind) = opt_kind {
152
- self . demand_eqtype ( expr. span ,
153
- kind. to_ty ( self . tcx ) ,
154
- substs. closure_kind_ty ( expr_def_id, self . tcx ) ) ;
153
+ self . demand_eqtype (
154
+ expr. span ,
155
+ kind. to_ty ( self . tcx ) ,
156
+ substs. closure_kind_ty ( expr_def_id, self . tcx ) ,
157
+ ) ;
155
158
}
156
159
157
160
closure_type
@@ -314,8 +317,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
314
317
let self_ty = self . shallow_resolve ( trait_ref. self_ty ( ) ) ;
315
318
debug ! (
316
319
"self_type_matches_expected_vid(trait_ref={:?}, self_ty={:?})" ,
317
- trait_ref,
318
- self_ty
320
+ trait_ref, self_ty
319
321
) ;
320
322
match self_ty. sty {
321
323
ty:: TyInfer ( ty:: TyVar ( v) ) if expected_vid == v => Some ( trait_ref) ,
@@ -564,7 +566,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
564
566
body : & hir:: Body ,
565
567
bound_sig : ty:: PolyFnSig < ' tcx > ,
566
568
) -> ClosureSignatures < ' tcx > {
567
- let liberated_sig = self . tcx ( ) . liberate_late_bound_regions ( expr_def_id, & bound_sig) ;
569
+ let liberated_sig = self . tcx ( )
570
+ . liberate_late_bound_regions ( expr_def_id, & bound_sig) ;
568
571
let liberated_sig = self . inh . normalize_associated_types_in (
569
572
body. value . span ,
570
573
body. value . id ,
0 commit comments