Skip to content

Commit d503fff

Browse files
committed
librustc: De-@mut resolve::Module::populated
1 parent a1ee381 commit d503fff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc/middle/resolve.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ struct Module {
455455
// Whether this module is populated. If not populated, any attempt to
456456
// access the children must be preceded with a
457457
// `populate_module_if_necessary` call.
458-
populated: bool,
458+
populated: Cell<bool>,
459459
}
460460

461461
impl Module {
@@ -477,7 +477,7 @@ impl Module {
477477
import_resolutions: @mut HashMap::new(),
478478
glob_count: 0,
479479
resolved_import_count: 0,
480-
populated: !external,
480+
populated: Cell::new(!external),
481481
}
482482
}
483483

@@ -1887,16 +1887,16 @@ impl Resolver {
18871887
child_ident,
18881888
visibility)
18891889
});
1890-
module.populated = true
1890+
module.populated.set(true)
18911891
}
18921892

18931893
/// Ensures that the reduced graph rooted at the given external module
18941894
/// is built, building it if it is not.
18951895
fn populate_module_if_necessary(&mut self, module: @mut Module) {
1896-
if !module.populated {
1896+
if !module.populated.get() {
18971897
self.populate_external_module(module)
18981898
}
1899-
assert!(module.populated)
1899+
assert!(module.populated.get())
19001900
}
19011901

19021902
/// Builds the reduced graph rooted at the 'use' directive for an external

0 commit comments

Comments
 (0)