@@ -168,15 +168,6 @@ pub struct Inherited<'a> {
168
168
upvar_borrow_map : RefCell < ty:: UpvarBorrowMap > ,
169
169
}
170
170
171
- #[ deriving( Clone ) ]
172
- pub enum FnKind {
173
- // A do-closure.
174
- DoBlock ,
175
-
176
- // A normal closure or fn item.
177
- Vanilla
178
- }
179
-
180
171
#[ deriving( Clone ) ]
181
172
pub struct FnStyleState {
182
173
pub def : ast:: NodeId ,
@@ -249,11 +240,6 @@ pub struct FnCtxt<'a> {
249
240
// can actually be made to live as long as it needs to live.
250
241
region_lb : Cell < ast:: NodeId > ,
251
242
252
- // Says whether we're inside a for loop, in a do block
253
- // or neither. Helps with error messages involving the
254
- // function return type.
255
- fn_kind : FnKind ,
256
-
257
243
inh : & ' a Inherited < ' a > ,
258
244
259
245
ccx : & ' a CrateCtxt < ' a > ,
@@ -289,7 +275,6 @@ fn blank_fn_ctxt<'a>(ccx: &'a CrateCtxt<'a>,
289
275
ret_ty : rty,
290
276
ps : RefCell :: new ( FnStyleState :: function ( ast:: NormalFn , 0 ) ) ,
291
277
region_lb : Cell :: new ( region_bnd) ,
292
- fn_kind : Vanilla ,
293
278
inh : inh,
294
279
ccx : ccx
295
280
}
@@ -356,7 +341,7 @@ fn check_bare_fn(ccx: &CrateCtxt,
356
341
ty:: ty_bare_fn( ref fn_ty) => {
357
342
let inh = Inherited :: new ( ccx. tcx , param_env) ;
358
343
let fcx = check_fn ( ccx, fn_ty. fn_style , & fn_ty. sig ,
359
- decl, id, body, Vanilla , & inh) ;
344
+ decl, id, body, & inh) ;
360
345
361
346
vtable:: resolve_in_block ( & fcx, body) ;
362
347
regionck:: regionck_fn ( & fcx, body) ;
@@ -440,7 +425,6 @@ fn check_fn<'a>(ccx: &'a CrateCtxt<'a>,
440
425
decl : & ast:: FnDecl ,
441
426
id : ast:: NodeId ,
442
427
body : & ast:: Block ,
443
- fn_kind : FnKind ,
444
428
inherited : & ' a Inherited < ' a > ) -> FnCtxt < ' a >
445
429
{
446
430
/*!
@@ -479,7 +463,6 @@ fn check_fn<'a>(ccx: &'a CrateCtxt<'a>,
479
463
ret_ty : ret_ty,
480
464
ps : RefCell :: new ( FnStyleState :: function ( fn_style, id) ) ,
481
465
region_lb : Cell :: new ( body. id ) ,
482
- fn_kind : fn_kind,
483
466
inh : inherited,
484
467
ccx : ccx
485
468
} ;
@@ -2295,7 +2278,6 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
2295
2278
store: ty:: TraitStore ,
2296
2279
decl: & ast:: FnDecl ,
2297
2280
body: ast:: P < ast:: Block > ,
2298
- fn_kind: FnKind ,
2299
2281
expected: Option < ty:: t > ) {
2300
2282
let tcx = fcx. ccx. tcx;
2301
2283
@@ -2373,7 +2355,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
2373
2355
} ;
2374
2356
2375
2357
check_fn( fcx. ccx, inherited_style, & fty_sig,
2376
- decl, id, body, fn_kind , fcx. inh) ;
2358
+ decl, id, body, fcx. inh) ;
2377
2359
}
2378
2360
2379
2361
@@ -3044,7 +3026,6 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
3044
3026
ty:: RegionTraitStore ( region, ast:: MutMutable ) ,
3045
3027
decl,
3046
3028
body,
3047
- Vanilla ,
3048
3029
expected) ;
3049
3030
}
3050
3031
ast:: ExprProc ( decl, body) => {
@@ -3053,7 +3034,6 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
3053
3034
ty:: UniqTraitStore ,
3054
3035
decl,
3055
3036
body,
3056
- Vanilla ,
3057
3037
expected) ;
3058
3038
}
3059
3039
ast:: ExprBlock ( b) => {
0 commit comments