Skip to content

Commit c12bb59

Browse files
committed
---
yaml --- r: 44442 b: refs/heads/master c: ae38935 h: refs/heads/master v: v3
1 parent 2929ec0 commit c12bb59

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7a6db3f982cea9c5c1ed9921358988c1180851dc
2+
refs/heads/master: ae38935ff3d295dbf2fca5a5cef5103e868678bb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/librustc/middle/check_const.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use middle::ty;
1616
use middle::typeck;
1717
use util::ppaux;
1818

19-
use core::dvec::DVec;
2019
use core::option;
2120
use std::oldmap::HashMap;
2221
use syntax::ast::*;
@@ -212,20 +211,20 @@ pub fn check_item_recursion(sess: Session,
212211
ast_map: ast_map::map,
213212
def_map: resolve::DefMap,
214213
it: @item) {
215-
type env = {
214+
struct env {
216215
root_it: @item,
217216
sess: Session,
218217
ast_map: ast_map::map,
219218
def_map: resolve::DefMap,
220-
idstack: @DVec<node_id>,
221-
};
219+
idstack: @mut ~[node_id]
220+
}
222221

223-
let env = {
222+
let env = env {
224223
root_it: it,
225224
sess: sess,
226225
ast_map: ast_map,
227226
def_map: def_map,
228-
idstack: @DVec()
227+
idstack: @mut ~[]
229228
};
230229

231230
let visitor = visit::mk_vt(@visit::Visitor {
@@ -236,12 +235,12 @@ pub fn check_item_recursion(sess: Session,
236235
(visitor.visit_item)(it, env, visitor);
237236

238237
fn visit_item(it: @item, &&env: env, v: visit::vt<env>) {
239-
if (*env.idstack).contains(&(it.id)) {
238+
if env.idstack.contains(&(it.id)) {
240239
env.sess.span_fatal(env.root_it.span, ~"recursive constant");
241240
}
242-
(*env.idstack).push(it.id);
241+
env.idstack.push(it.id);
243242
visit::visit_item(it, env, v);
244-
(*env.idstack).pop();
243+
env.idstack.pop();
245244
}
246245

247246
fn visit_expr(e: @expr, &&env: env, v: visit::vt<env>) {

0 commit comments

Comments
 (0)