Skip to content

Commit 381505f

Browse files
committed
Remove useless return value in typeck::check_decl_local
1 parent 022363a commit 381505f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/comp/middle/typeck.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -2425,26 +2425,22 @@ fn check_decl_initializer(&@fn_ctxt fcx, ast::node_id nid,
24252425
}
24262426
}
24272427

2428-
fn check_decl_local(&@fn_ctxt fcx, &@ast::local local) -> @ast::local {
2428+
fn check_decl_local(&@fn_ctxt fcx, &@ast::local local) {
24292429
auto a_id = local.node.id;
24302430
alt (fcx.locals.find(a_id)) {
24312431
case (none) {
2432-
24332432
fcx.ccx.tcx.sess.bug("check_decl_local: local id not found " +
24342433
local.node.ident);
24352434
}
24362435
case (some(?i)) {
24372436
auto t = ty::mk_var(fcx.ccx.tcx, i);
24382437
write::ty_only_fixup(fcx, a_id, t);
2439-
auto initopt = local.node.init;
2440-
alt (initopt) {
2438+
alt (local.node.init) {
24412439
case (some(?init)) {
24422440
check_decl_initializer(fcx, local.node.id, init);
24432441
}
24442442
case (_) {/* fall through */ }
24452443
}
2446-
auto newlocal = rec(init=initopt with local.node);
2447-
ret @rec(node=newlocal, span=local.span);
24482444
}
24492445
}
24502446
}

0 commit comments

Comments
 (0)