Skip to content

Commit 507c1a0

Browse files
committed
auto merge of #14632 : luqmana/rust/cu, r=huonw
The distinction doesn't make sense any more since we don't have do blocks anymore.
2 parents f5ead0d + 559ff5e commit 507c1a0

File tree

1 file changed

+2
-22
lines changed
  • src/librustc/middle/typeck/check

1 file changed

+2
-22
lines changed

src/librustc/middle/typeck/check/mod.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,6 @@ pub struct Inherited<'a> {
168168
upvar_borrow_map: RefCell<ty::UpvarBorrowMap>,
169169
}
170170

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-
180171
#[deriving(Clone)]
181172
pub struct FnStyleState {
182173
pub def: ast::NodeId,
@@ -249,11 +240,6 @@ pub struct FnCtxt<'a> {
249240
// can actually be made to live as long as it needs to live.
250241
region_lb: Cell<ast::NodeId>,
251242

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-
257243
inh: &'a Inherited<'a>,
258244

259245
ccx: &'a CrateCtxt<'a>,
@@ -289,7 +275,6 @@ fn blank_fn_ctxt<'a>(ccx: &'a CrateCtxt<'a>,
289275
ret_ty: rty,
290276
ps: RefCell::new(FnStyleState::function(ast::NormalFn, 0)),
291277
region_lb: Cell::new(region_bnd),
292-
fn_kind: Vanilla,
293278
inh: inh,
294279
ccx: ccx
295280
}
@@ -356,7 +341,7 @@ fn check_bare_fn(ccx: &CrateCtxt,
356341
ty::ty_bare_fn(ref fn_ty) => {
357342
let inh = Inherited::new(ccx.tcx, param_env);
358343
let fcx = check_fn(ccx, fn_ty.fn_style, &fn_ty.sig,
359-
decl, id, body, Vanilla, &inh);
344+
decl, id, body, &inh);
360345

361346
vtable::resolve_in_block(&fcx, body);
362347
regionck::regionck_fn(&fcx, body);
@@ -440,7 +425,6 @@ fn check_fn<'a>(ccx: &'a CrateCtxt<'a>,
440425
decl: &ast::FnDecl,
441426
id: ast::NodeId,
442427
body: &ast::Block,
443-
fn_kind: FnKind,
444428
inherited: &'a Inherited<'a>) -> FnCtxt<'a>
445429
{
446430
/*!
@@ -479,7 +463,6 @@ fn check_fn<'a>(ccx: &'a CrateCtxt<'a>,
479463
ret_ty: ret_ty,
480464
ps: RefCell::new(FnStyleState::function(fn_style, id)),
481465
region_lb: Cell::new(body.id),
482-
fn_kind: fn_kind,
483466
inh: inherited,
484467
ccx: ccx
485468
};
@@ -2295,7 +2278,6 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
22952278
store: ty::TraitStore,
22962279
decl: &ast::FnDecl,
22972280
body: ast::P<ast::Block>,
2298-
fn_kind: FnKind,
22992281
expected: Option<ty::t>) {
23002282
let tcx = fcx.ccx.tcx;
23012283

@@ -2373,7 +2355,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
23732355
};
23742356

23752357
check_fn(fcx.ccx, inherited_style, &fty_sig,
2376-
decl, id, body, fn_kind, fcx.inh);
2358+
decl, id, body, fcx.inh);
23772359
}
23782360

23792361

@@ -3044,7 +3026,6 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
30443026
ty::RegionTraitStore(region, ast::MutMutable),
30453027
decl,
30463028
body,
3047-
Vanilla,
30483029
expected);
30493030
}
30503031
ast::ExprProc(decl, body) => {
@@ -3053,7 +3034,6 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
30533034
ty::UniqTraitStore,
30543035
decl,
30553036
body,
3056-
Vanilla,
30573037
expected);
30583038
}
30593039
ast::ExprBlock(b) => {

0 commit comments

Comments
 (0)