@@ -100,7 +100,7 @@ type glob_imp_def = {def: def, path: @ast::view_path};
100
100
type indexed_mod = {
101
101
m : option < ast:: _mod > ,
102
102
index : mod_index ,
103
- mut glob_imports : [ glob_imp_def ] ,
103
+ glob_imports : dvec < glob_imp_def > ,
104
104
mut globbed_exports : [ ident ] ,
105
105
glob_imported_names : hashmap < str , glob_import_state > ,
106
106
path: str
@@ -123,7 +123,7 @@ type env =
123
123
def_map : def_map ,
124
124
ast_map : ast_map:: map ,
125
125
imports : hashmap < node_id , import_state > ,
126
- mut exp_map : exp_map ,
126
+ exp_map : exp_map ,
127
127
mod_map : hashmap < node_id , @indexed_mod > ,
128
128
block_map : hashmap < node_id , [ glob_imp_def ] > ,
129
129
ext_map : ext_map ,
@@ -132,7 +132,7 @@ type env =
132
132
ext_cache : ext_hash ,
133
133
used_imports : { mut track : bool ,
134
134
mut data : [ node_id ] } ,
135
- mut reported : [ { ident: str , sc : scope } ] ,
135
+ reported : dvec < { ident: str , sc : scope } > ,
136
136
mut ignored_imports : [ node_id ] ,
137
137
mut current_tp : option < uint > ,
138
138
mut resolve_unexported : bool ,
@@ -174,15 +174,15 @@ fn create_env(sess: session, amap: ast_map::map) -> @env {
174
174
def_map: int_hash ( ) ,
175
175
ast_map: amap,
176
176
imports: int_hash ( ) ,
177
- mut exp_map: int_hash ( ) ,
177
+ exp_map: int_hash ( ) ,
178
178
mod_map: int_hash ( ) ,
179
179
block_map: int_hash ( ) ,
180
180
ext_map: new_def_hash ( ) ,
181
181
impl_map: int_hash ( ) ,
182
182
impl_cache: new_def_hash ( ) ,
183
183
ext_cache: new_ext_hash ( ) ,
184
184
used_imports : { mut track : false , mut data : [ ] } ,
185
- mut reported: [ ] ,
185
+ reported: dvec ( ) ,
186
186
mut ignored_imports: [ ] ,
187
187
mut current_tp: none,
188
188
mut resolve_unexported: false ,
@@ -270,7 +270,7 @@ fn map_crate(e: @env, c: @ast::crate) {
270
270
e. mod_map . insert ( i. id ,
271
271
@{ m: some ( md) ,
272
272
index: index_mod ( md) ,
273
- mut glob_imports: [ ] ,
273
+ glob_imports: dvec ( ) ,
274
274
mut globbed_exports: [ ] ,
275
275
glob_imported_names : str_hash( ) ,
276
276
path: path_from_scope ( sc, i. ident ) } ) ;
@@ -279,7 +279,7 @@ fn map_crate(e: @env, c: @ast::crate) {
279
279
e. mod_map . insert ( i. id ,
280
280
@{ m: none :: < ast:: _mod > ,
281
281
index: index_nmod ( nmd) ,
282
- mut glob_imports: [ ] ,
282
+ glob_imports: dvec ( ) ,
283
283
mut globbed_exports: [ ] ,
284
284
glob_imported_names : str_hash( ) ,
285
285
path: path_from_scope ( sc, i. ident ) } ) ;
@@ -301,7 +301,7 @@ fn map_crate(e: @env, c: @ast::crate) {
301
301
let glob = { def: imp, path: vp} ;
302
302
alt list:: head ( sc) {
303
303
scope_item ( i) {
304
- e. mod_map . get ( i. id ) . glob_imports += [ glob] ;
304
+ e. mod_map . get ( i. id ) . glob_imports . push ( glob) ;
305
305
}
306
306
scope_block ( b, _, _) {
307
307
let globs = alt e. block_map . find ( b. node . id ) {
@@ -311,8 +311,8 @@ fn map_crate(e: @env, c: @ast::crate) {
311
311
e. block_map . insert ( b. node . id , globs) ;
312
312
}
313
313
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) ;
316
316
}
317
317
_ { e. sess . span_bug ( vi. span , "unexpected scope in a \
318
318
glob import") ; }
@@ -338,7 +338,7 @@ fn map_crate(e: @env, c: @ast::crate) {
338
338
e. mod_map . insert ( ast:: crate_node_id,
339
339
@{ m: some ( c. node . module ) ,
340
340
index: index_mod ( c. node . module ) ,
341
- mut glob_imports: [ ] ,
341
+ glob_imports: dvec ( ) ,
342
342
mut globbed_exports: [ ] ,
343
343
glob_imported_names : str_hash( ) ,
344
344
path: "" } ) ;
@@ -899,7 +899,7 @@ fn unresolved_err(e: env, cx: ctxt, sp: span, name: ident, kind: str) {
899
899
for e. reported. each { |rs|
900
900
if str:: eq( rs. ident, name) && err_scope == rs. sc { ret; }
901
901
}
902
- e. reported += [ { ident: name, sc: err_scope} ] ;
902
+ e. reported. push ( { ident: name, sc: err_scope} ) ;
903
903
}
904
904
_ { }
905
905
}
@@ -1536,7 +1536,7 @@ fn lookup_glob_in_mod(e: env, info: @indexed_mod, sp: span, id: ident,
1536
1536
// absence takes the place of todo()
1537
1537
if !info. glob_imported_names . contains_key ( id) {
1538
1538
info. glob_imported_names . insert ( id, glob_resolving ( sp) ) ;
1539
- let globs = info. glob_imports ;
1539
+ let globs = info. glob_imports . get ( ) ;
1540
1540
let val = lookup_in_globs ( e, globs, sp, id, ns_val, dr) ;
1541
1541
let typ = lookup_in_globs ( e, globs, sp, id, ns_type, dr) ;
1542
1542
let md = lookup_in_globs ( e, globs, sp, id, ns_module, dr) ;
0 commit comments