Skip to content

Commit 2616441

Browse files
committed
---
yaml --- r: 147553 b: refs/heads/try2 c: ec02f94 h: refs/heads/master i: 147551: 10f90f9 v: v3
1 parent 33b2c1a commit 2616441

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 01d8380b19f63f1a8acafcc340c7e964b55fda82
8+
refs/heads/try2: ec02f9457cfbd336296951bad66dcb621c865166
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ struct Module {
450450
glob_count: Cell<uint>,
451451

452452
// The index of the import we're resolving.
453-
resolved_import_count: uint,
453+
resolved_import_count: Cell<uint>,
454454

455455
// Whether this module is populated. If not populated, any attempt to
456456
// access the children must be preceded with a
@@ -476,14 +476,14 @@ impl Module {
476476
anonymous_children: @mut HashMap::new(),
477477
import_resolutions: @mut HashMap::new(),
478478
glob_count: Cell::new(0),
479-
resolved_import_count: 0,
479+
resolved_import_count: Cell::new(0),
480480
populated: Cell::new(!external),
481481
}
482482
}
483483

484484
fn all_imports_resolved(&self) -> bool {
485485
let imports = &mut *self.imports;
486-
return imports.len() == self.resolved_import_count;
486+
return imports.len() == self.resolved_import_count.get();
487487
}
488488
}
489489

@@ -2039,8 +2039,8 @@ impl Resolver {
20392039

20402040
let imports = &mut *module.imports;
20412041
let import_count = imports.len();
2042-
while module.resolved_import_count < import_count {
2043-
let import_index = module.resolved_import_count;
2042+
while module.resolved_import_count.get() < import_count {
2043+
let import_index = module.resolved_import_count.get();
20442044
let import_directive = imports[import_index];
20452045
match self.resolve_import_for_module(module, import_directive) {
20462046
Failed => {
@@ -2060,7 +2060,8 @@ impl Resolver {
20602060
}
20612061
}
20622062

2063-
module.resolved_import_count += 1;
2063+
module.resolved_import_count
2064+
.set(module.resolved_import_count.get() + 1);
20642065
}
20652066
}
20662067

@@ -3151,7 +3152,7 @@ impl Resolver {
31513152
}
31523153

31533154
fn report_unresolved_imports(&mut self, module_: @mut Module) {
3154-
let index = module_.resolved_import_count;
3155+
let index = module_.resolved_import_count.get();
31553156
let imports: &mut ~[@ImportDirective] = &mut *module_.imports;
31563157
let import_count = imports.len();
31573158
if index != import_count {

0 commit comments

Comments
 (0)