Skip to content

Commit 9be612f

Browse files
committed
move resolve to dvec, remove unnecessary mut annotations
1 parent 594e01d commit 9be612f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/rustc/middle/resolve.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ type glob_imp_def = {def: def, path: @ast::view_path};
100100
type indexed_mod = {
101101
m: option<ast::_mod>,
102102
index: mod_index,
103-
mut glob_imports: [glob_imp_def],
103+
glob_imports: dvec<glob_imp_def>,
104104
mut globbed_exports: [ident],
105105
glob_imported_names: hashmap<str, glob_import_state>,
106106
path: str
@@ -123,7 +123,7 @@ type env =
123123
def_map: def_map,
124124
ast_map: ast_map::map,
125125
imports: hashmap<node_id, import_state>,
126-
mut exp_map: exp_map,
126+
exp_map: exp_map,
127127
mod_map: hashmap<node_id, @indexed_mod>,
128128
block_map: hashmap<node_id, [glob_imp_def]>,
129129
ext_map: ext_map,
@@ -132,7 +132,7 @@ type env =
132132
ext_cache: ext_hash,
133133
used_imports: {mut track: bool,
134134
mut data: [node_id]},
135-
mut reported: [{ident: str, sc: scope}],
135+
reported: dvec<{ident: str, sc: scope}>,
136136
mut ignored_imports: [node_id],
137137
mut current_tp: option<uint>,
138138
mut resolve_unexported: bool,
@@ -174,15 +174,15 @@ fn create_env(sess: session, amap: ast_map::map) -> @env {
174174
def_map: int_hash(),
175175
ast_map: amap,
176176
imports: int_hash(),
177-
mut exp_map: int_hash(),
177+
exp_map: int_hash(),
178178
mod_map: int_hash(),
179179
block_map: int_hash(),
180180
ext_map: new_def_hash(),
181181
impl_map: int_hash(),
182182
impl_cache: new_def_hash(),
183183
ext_cache: new_ext_hash(),
184184
used_imports: {mut track: false, mut data: []},
185-
mut reported: [],
185+
reported: dvec(),
186186
mut ignored_imports: [],
187187
mut current_tp: none,
188188
mut resolve_unexported: false,
@@ -270,7 +270,7 @@ fn map_crate(e: @env, c: @ast::crate) {
270270
e.mod_map.insert(i.id,
271271
@{m: some(md),
272272
index: index_mod(md),
273-
mut glob_imports: [],
273+
glob_imports: dvec(),
274274
mut globbed_exports: [],
275275
glob_imported_names: str_hash(),
276276
path: path_from_scope(sc, i.ident)});
@@ -279,7 +279,7 @@ fn map_crate(e: @env, c: @ast::crate) {
279279
e.mod_map.insert(i.id,
280280
@{m: none::<ast::_mod>,
281281
index: index_nmod(nmd),
282-
mut glob_imports: [],
282+
glob_imports: dvec(),
283283
mut globbed_exports: [],
284284
glob_imported_names: str_hash(),
285285
path: path_from_scope(sc, i.ident)});
@@ -301,7 +301,7 @@ fn map_crate(e: @env, c: @ast::crate) {
301301
let glob = {def: imp, path: vp};
302302
alt list::head(sc) {
303303
scope_item(i) {
304-
e.mod_map.get(i.id).glob_imports += [glob];
304+
e.mod_map.get(i.id).glob_imports.push(glob);
305305
}
306306
scope_block(b, _, _) {
307307
let globs = alt e.block_map.find(b.node.id) {
@@ -311,8 +311,8 @@ fn map_crate(e: @env, c: @ast::crate) {
311311
e.block_map.insert(b.node.id, globs);
312312
}
313313
scope_crate {
314-
e.mod_map.get(ast::crate_node_id).glob_imports
315-
+= [glob];
314+
e.mod_map.get(ast::crate_node_id).
315+
glob_imports.push(glob);
316316
}
317317
_ { e.sess.span_bug(vi.span, "unexpected scope in a \
318318
glob import"); }
@@ -338,7 +338,7 @@ fn map_crate(e: @env, c: @ast::crate) {
338338
e.mod_map.insert(ast::crate_node_id,
339339
@{m: some(c.node.module),
340340
index: index_mod(c.node.module),
341-
mut glob_imports: [],
341+
glob_imports: dvec(),
342342
mut globbed_exports: [],
343343
glob_imported_names: str_hash(),
344344
path: ""});
@@ -899,7 +899,7 @@ fn unresolved_err(e: env, cx: ctxt, sp: span, name: ident, kind: str) {
899899
for e.reported.each {|rs|
900900
if str::eq(rs.ident, name) && err_scope == rs.sc { ret; }
901901
}
902-
e.reported += [{ident: name, sc: err_scope}];
902+
e.reported.push({ident: name, sc: err_scope});
903903
}
904904
_ {}
905905
}
@@ -1536,7 +1536,7 @@ fn lookup_glob_in_mod(e: env, info: @indexed_mod, sp: span, id: ident,
15361536
// absence takes the place of todo()
15371537
if !info.glob_imported_names.contains_key(id) {
15381538
info.glob_imported_names.insert(id, glob_resolving(sp));
1539-
let globs = info.glob_imports;
1539+
let globs = info.glob_imports.get();
15401540
let val = lookup_in_globs(e, globs, sp, id, ns_val, dr);
15411541
let typ = lookup_in_globs(e, globs, sp, id, ns_type, dr);
15421542
let md = lookup_in_globs(e, globs, sp, id, ns_module, dr);

0 commit comments

Comments
 (0)