Skip to content

Commit f68f228

Browse files
committed
Switch Module.import_resolutions from oldmap
1 parent e84323e commit f68f228

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/librustc/middle/resolve.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ pub struct Module {
478478
anonymous_children: @HashMap<node_id,@mut Module>,
479479
480480
// The status of resolving each import in this module.
481-
import_resolutions: @HashMap<ident,@mut ImportResolution>,
481+
import_resolutions: @mut LinearMap<ident, @mut ImportResolution>,
482482
483483
// The number of unresolved globs that this module exports.
484484
glob_count: uint,
@@ -498,7 +498,7 @@ pub fn Module(parent_link: ParentLink,
498498
children: @mut LinearMap::new(),
499499
imports: @mut ~[],
500500
anonymous_children: @HashMap(),
501-
import_resolutions: @HashMap(),
501+
import_resolutions: @mut LinearMap::new(),
502502
glob_count: 0,
503503
resolved_import_count: 0
504504
}
@@ -2242,11 +2242,11 @@ pub impl Resolver {
22422242
// The name is an import which has been fully
22432243
// resolved. We can, therefore, just follow it.
22442244
if value_result.is_unknown() {
2245-
value_result = get_binding(import_resolution,
2245+
value_result = get_binding(*import_resolution,
22462246
ValueNS);
22472247
}
22482248
if type_result.is_unknown() {
2249-
type_result = get_binding(import_resolution,
2249+
type_result = get_binding(*import_resolution,
22502250
TypeNS);
22512251
}
22522252
}
@@ -2484,15 +2484,15 @@ pub impl Resolver {
24842484
24852485
// Add all resolved imports from the containing module.
24862486
for containing_module.import_resolutions.each
2487-
|&ident, &target_import_resolution| {
2487+
|&(ident, target_import_resolution)| {
24882488
24892489
debug!("(resolving glob import) writing module resolution \
24902490
%? into `%s`",
24912491
is_none(&mut target_import_resolution.type_target),
24922492
self.module_to_str(module_));
24932493

24942494
// Here we merge two import resolutions.
2495-
match module_.import_resolutions.find(&ident) {
2495+
match module_.import_resolutions.find(ident) {
24962496
None if target_import_resolution.privacy == Public => {
24972497
// Simple: just copy the old import resolution.
24982498
let new_import_resolution =
@@ -2505,7 +2505,7 @@ pub impl Resolver {
25052505
copy target_import_resolution.type_target;
25062506

25072507
module_.import_resolutions.insert
2508-
(ident, new_import_resolution);
2508+
(*ident, new_import_resolution);
25092509
}
25102510
None => { /* continue ... */ }
25112511
Some(dest_import_resolution) => {
@@ -2547,7 +2547,7 @@ pub impl Resolver {
25472547
(*ident, dest_import_resolution);
25482548
}
25492549
Some(existing_import_resolution) => {
2550-
dest_import_resolution = existing_import_resolution;
2550+
dest_import_resolution = *existing_import_resolution;
25512551
}
25522552
}
25532553

@@ -3205,7 +3205,7 @@ pub impl Resolver {
32053205
false);
32063206
}
32073207
3208-
for module_.import_resolutions.each |ident, importresolution| {
3208+
for module_.import_resolutions.each |&(ident, importresolution)| {
32093209
if importresolution.privacy != Public {
32103210
debug!("(computing exports) not reexporting private `%s`",
32113211
*self.session.str_of(*ident));
@@ -5308,9 +5308,9 @@ pub impl Resolver {
53085308
}
53095309

53105310
debug!("Import resolutions:");
5311-
for module_.import_resolutions.each |&name, &import_resolution| {
5311+
for module_.import_resolutions.each |&(name, import_resolution)| {
53125312
let mut value_repr;
5313-
match (*import_resolution).target_for_namespace(ValueNS) {
5313+
match import_resolution.target_for_namespace(ValueNS) {
53145314
None => { value_repr = ~""; }
53155315
Some(_) => {
53165316
value_repr = ~" value:?";
@@ -5319,15 +5319,15 @@ pub impl Resolver {
53195319
}
53205320

53215321
let mut type_repr;
5322-
match (*import_resolution).target_for_namespace(TypeNS) {
5322+
match import_resolution.target_for_namespace(TypeNS) {
53235323
None => { type_repr = ~""; }
53245324
Some(_) => {
53255325
type_repr = ~" type:?";
53265326
// FIXME #4954
53275327
}
53285328
}
53295329

5330-
debug!("* %s:%s%s", *self.session.str_of(name),
5330+
debug!("* %s:%s%s", *self.session.str_of(*name),
53315331
value_repr, type_repr);
53325332
}
53335333
}

0 commit comments

Comments
 (0)