From d503fff28ef8498e9e4ba9fb36f63f6905e882a7 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 19 Dec 2013 18:53:59 -0800 Subject: [PATCH] librustc: De-`@mut` `resolve::Module::populated` --- src/librustc/middle/resolve.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index a012dc5b91a..e2bd6d35366 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -455,7 +455,7 @@ struct Module { // Whether this module is populated. If not populated, any attempt to // access the children must be preceded with a // `populate_module_if_necessary` call. - populated: bool, + populated: Cell, } impl Module { @@ -477,7 +477,7 @@ impl Module { import_resolutions: @mut HashMap::new(), glob_count: 0, resolved_import_count: 0, - populated: !external, + populated: Cell::new(!external), } } @@ -1887,16 +1887,16 @@ impl Resolver { child_ident, visibility) }); - module.populated = true + module.populated.set(true) } /// Ensures that the reduced graph rooted at the given external module /// is built, building it if it is not. fn populate_module_if_necessary(&mut self, module: @mut Module) { - if !module.populated { + if !module.populated.get() { self.populate_external_module(module) } - assert!(module.populated) + assert!(module.populated.get()) } /// Builds the reduced graph rooted at the 'use' directive for an external