From c10d7177db81bd207705a92f6453f82ab11521a7 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sat, 21 Dec 2013 17:45:02 -0800 Subject: [PATCH] librustc: De-`@mut` `ImportResolution::value_id` --- src/librustc/middle/resolve.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index 6beb9f3192a..b7a44fd948d 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -358,7 +358,7 @@ struct ImportResolution { value_target: RefCell>, /// The source node of the `use` directive leading to the value target /// being non-none - value_id: NodeId, + value_id: Cell, /// The type that this `use` directive names, if there is one. type_target: Option, @@ -371,7 +371,7 @@ impl ImportResolution { fn new(id: NodeId, is_public: bool) -> ImportResolution { ImportResolution { type_id: id, - value_id: id, + value_id: Cell::new(id), outstanding_references: Cell::new(0), value_target: RefCell::new(None), type_target: None, @@ -390,7 +390,7 @@ fn target_for_namespace(&self, namespace: Namespace) fn id(&self, namespace: Namespace) -> NodeId { match namespace { TypeNS => self.type_id, - ValueNS => self.value_id, + ValueNS => self.value_id.get(), } } } @@ -1974,7 +1974,7 @@ fn build_import_directive(&mut self, // the source of this name is different now resolution.type_id = id; - resolution.value_id = id; + resolution.value_id.set(id); } None => { debug!("(building import directive) creating new"); @@ -2421,7 +2421,7 @@ fn get_binding(this: &mut Resolver, debug!("(resolving single import) found value target"); import_resolution.value_target.set( Some(Target::new(target_module, name_bindings))); - import_resolution.value_id = directive.id; + import_resolution.value_id.set(directive.id); used_public = name_bindings.defined_in_public_namespace(ValueNS); } UnboundResult => { /* Continue. */ } @@ -2598,7 +2598,7 @@ fn resolve_glob_import(&mut self, debug!("(resolving glob import) ... for value target"); dest_import_resolution.value_target.set( Some(Target::new(containing_module, name_bindings))); - dest_import_resolution.value_id = id; + dest_import_resolution.value_id.set(id); } if name_bindings.defined_in_public_namespace(TypeNS) { debug!("(resolving glob import) ... for type target");