Skip to content

Commit 87288a1

Browse files
committed
rustc: Make check_const() not rebuild the AST (although it's not called at the moment!)
1 parent d217418 commit 87288a1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/comp/middle/typeck.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,7 +2662,7 @@ fn check_block(&@fn_ctxt fcx, &ast::block block) {
26622662
}
26632663

26642664
fn check_const(&@crate_ctxt ccx, &span sp, &ast::ident ident, &@ast::ty t,
2665-
&@ast::expr e, &ast::def_id id, &ast::ann ann) -> @ast::item {
2665+
&@ast::expr e, &ast::def_id id, &ast::ann ann) {
26662666
// FIXME: this is kinda a kludge; we manufacture a fake "function context"
26672667
// for checking the initializer expression.
26682668
auto rty = ann_to_type(ccx.node_types, ann);
@@ -2671,10 +2671,7 @@ fn check_const(&@crate_ctxt ccx, &span sp, &ast::ident ident, &@ast::ty t,
26712671
locals = @common::new_def_hash[ty::t](),
26722672
ccx = ccx);
26732673
check_expr(fcx, e);
2674-
// FIXME: necessary? Correct sequence?
26752674
Pushdown::pushdown_expr(fcx, rty, e);
2676-
auto item = ast::item_const(ident, t, e, id, ann);
2677-
ret @fold::respan[ast::item_](sp, item);
26782675
}
26792676

26802677
fn check_fn(&@crate_ctxt ccx, &ast::fn_decl decl, ast::proto proto,

0 commit comments

Comments
 (0)