Skip to content

Commit 4af8564

Browse files
committed
Rename Module field children to resolutions
1 parent b7889ef commit 4af8564

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/librustc_resolve/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ pub struct ModuleS<'a> {
798798
is_public: bool,
799799
is_extern_crate: bool,
800800

801-
children: RefCell<HashMap<(Name, Namespace), NameResolution<'a>>>,
801+
resolutions: RefCell<HashMap<(Name, Namespace), NameResolution<'a>>>,
802802
imports: RefCell<Vec<ImportDirective>>,
803803

804804
// The anonymous children of this node. Anonymous children are pseudo-
@@ -846,7 +846,7 @@ impl<'a> ModuleS<'a> {
846846
def: def,
847847
is_public: is_public,
848848
is_extern_crate: false,
849-
children: RefCell::new(HashMap::new()),
849+
resolutions: RefCell::new(HashMap::new()),
850850
imports: RefCell::new(Vec::new()),
851851
anonymous_children: RefCell::new(NodeMap()),
852852
shadowed_traits: RefCell::new(Vec::new()),
@@ -863,7 +863,7 @@ impl<'a> ModuleS<'a> {
863863
let glob_count =
864864
if allow_private_imports { self.glob_count.get() } else { self.pub_glob_count.get() };
865865

866-
self.children.borrow().get(&(name, ns)).cloned().unwrap_or_default().result(glob_count)
866+
self.resolutions.borrow().get(&(name, ns)).cloned().unwrap_or_default().result(glob_count)
867867
.and_then(|binding| {
868868
let allowed = allow_private_imports || !binding.is_import() || binding.is_public();
869869
if allowed { Success(binding) } else { Failed(None) }
@@ -873,7 +873,7 @@ impl<'a> ModuleS<'a> {
873873
// Define the name or return the existing binding if there is a collision.
874874
fn try_define_child(&self, name: Name, ns: Namespace, binding: &'a NameBinding<'a>)
875875
-> Result<(), &'a NameBinding<'a>> {
876-
let mut children = self.children.borrow_mut();
876+
let mut children = self.resolutions.borrow_mut();
877877
let resolution = children.entry((name, ns)).or_insert_with(Default::default);
878878

879879
// FIXME #31379: We can use methods from imported traits shadowed by non-import items
@@ -889,19 +889,19 @@ impl<'a> ModuleS<'a> {
889889
}
890890

891891
fn increment_outstanding_references_for(&self, name: Name, ns: Namespace) {
892-
let mut children = self.children.borrow_mut();
892+
let mut children = self.resolutions.borrow_mut();
893893
children.entry((name, ns)).or_insert_with(Default::default).outstanding_references += 1;
894894
}
895895

896896
fn decrement_outstanding_references_for(&self, name: Name, ns: Namespace) {
897-
match self.children.borrow_mut().get_mut(&(name, ns)).unwrap().outstanding_references {
897+
match self.resolutions.borrow_mut().get_mut(&(name, ns)).unwrap().outstanding_references {
898898
0 => panic!("No more outstanding references!"),
899899
ref mut outstanding_references => { *outstanding_references -= 1; }
900900
}
901901
}
902902

903903
fn for_each_child<F: FnMut(Name, Namespace, &'a NameBinding<'a>)>(&self, mut f: F) {
904-
for (&(name, ns), name_resolution) in self.children.borrow().iter() {
904+
for (&(name, ns), name_resolution) in self.resolutions.borrow().iter() {
905905
name_resolution.binding.map(|binding| f(name, ns, binding));
906906
}
907907
}

src/librustc_resolve/resolve_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
406406
match (&value_result, &type_result) {
407407
(&Indeterminate, _) | (_, &Indeterminate) => return Indeterminate,
408408
(&Failed(_), &Failed(_)) => {
409-
let children = target_module.children.borrow();
409+
let children = target_module.resolutions.borrow();
410410
let names = children.keys().map(|&(ref name, _)| name);
411411
let lev_suggestion = match find_best_match_for_name(names, &source.as_str(), None) {
412412
Some(name) => format!(". Did you mean to use `{}`?", name),

0 commit comments

Comments
 (0)