diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-02-14 08:46:54 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-02-14 08:47:55 +0000 |
| commit | 4af85643b13f9eae3de6fe15f06825c4d197752d (patch) | |
| tree | 547bc108c6d4b23fdb1b93739a02e5c19b827a44 | |
| parent | b7889ef23598524f310b8bb863271299bab628a6 (diff) | |
| download | rust-4af85643b13f9eae3de6fe15f06825c4d197752d.tar.gz rust-4af85643b13f9eae3de6fe15f06825c4d197752d.zip | |
Rename Module field children to resolutions
| -rw-r--r-- | src/librustc_resolve/lib.rs | 14 | ||||
| -rw-r--r-- | src/librustc_resolve/resolve_imports.rs | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index f0e4d7578e3..82856b7a4c7 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -798,7 +798,7 @@ pub struct ModuleS<'a> { is_public: bool, is_extern_crate: bool, - children: RefCell<HashMap<(Name, Namespace), NameResolution<'a>>>, + resolutions: RefCell<HashMap<(Name, Namespace), NameResolution<'a>>>, imports: RefCell<Vec<ImportDirective>>, // The anonymous children of this node. Anonymous children are pseudo- @@ -846,7 +846,7 @@ impl<'a> ModuleS<'a> { def: def, is_public: is_public, is_extern_crate: false, - children: RefCell::new(HashMap::new()), + resolutions: RefCell::new(HashMap::new()), imports: RefCell::new(Vec::new()), anonymous_children: RefCell::new(NodeMap()), shadowed_traits: RefCell::new(Vec::new()), @@ -863,7 +863,7 @@ impl<'a> ModuleS<'a> { let glob_count = if allow_private_imports { self.glob_count.get() } else { self.pub_glob_count.get() }; - self.children.borrow().get(&(name, ns)).cloned().unwrap_or_default().result(glob_count) + self.resolutions.borrow().get(&(name, ns)).cloned().unwrap_or_default().result(glob_count) .and_then(|binding| { let allowed = allow_private_imports || !binding.is_import() || binding.is_public(); if allowed { Success(binding) } else { Failed(None) } @@ -873,7 +873,7 @@ impl<'a> ModuleS<'a> { // Define the name or return the existing binding if there is a collision. fn try_define_child(&self, name: Name, ns: Namespace, binding: &'a NameBinding<'a>) -> Result<(), &'a NameBinding<'a>> { - let mut children = self.children.borrow_mut(); + let mut children = self.resolutions.borrow_mut(); let resolution = children.entry((name, ns)).or_insert_with(Default::default); // FIXME #31379: We can use methods from imported traits shadowed by non-import items @@ -889,19 +889,19 @@ impl<'a> ModuleS<'a> { } fn increment_outstanding_references_for(&self, name: Name, ns: Namespace) { - let mut children = self.children.borrow_mut(); + let mut children = self.resolutions.borrow_mut(); children.entry((name, ns)).or_insert_with(Default::default).outstanding_references += 1; } fn decrement_outstanding_references_for(&self, name: Name, ns: Namespace) { - match self.children.borrow_mut().get_mut(&(name, ns)).unwrap().outstanding_references { + match self.resolutions.borrow_mut().get_mut(&(name, ns)).unwrap().outstanding_references { 0 => panic!("No more outstanding references!"), ref mut outstanding_references => { *outstanding_references -= 1; } } } fn for_each_child<F: FnMut(Name, Namespace, &'a NameBinding<'a>)>(&self, mut f: F) { - for (&(name, ns), name_resolution) in self.children.borrow().iter() { + for (&(name, ns), name_resolution) in self.resolutions.borrow().iter() { name_resolution.binding.map(|binding| f(name, ns, binding)); } } diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index 13b595e7234..1ad9eaeba1e 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -406,7 +406,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> { match (&value_result, &type_result) { (&Indeterminate, _) | (_, &Indeterminate) => return Indeterminate, (&Failed(_), &Failed(_)) => { - let children = target_module.children.borrow(); + let children = target_module.resolutions.borrow(); let names = children.keys().map(|&(ref name, _)| name); let lev_suggestion = match find_best_match_for_name(names, &source.as_str(), None) { Some(name) => format!(". Did you mean to use `{}`?", name), |
