@@ -798,7 +798,7 @@ pub struct ModuleS<'a> {
798
798
is_public : bool ,
799
799
is_extern_crate : bool ,
800
800
801
- children : RefCell < HashMap < ( Name , Namespace ) , NameResolution < ' a > > > ,
801
+ resolutions : RefCell < HashMap < ( Name , Namespace ) , NameResolution < ' a > > > ,
802
802
imports : RefCell < Vec < ImportDirective > > ,
803
803
804
804
// The anonymous children of this node. Anonymous children are pseudo-
@@ -846,7 +846,7 @@ impl<'a> ModuleS<'a> {
846
846
def : def,
847
847
is_public : is_public,
848
848
is_extern_crate : false ,
849
- children : RefCell :: new ( HashMap :: new ( ) ) ,
849
+ resolutions : RefCell :: new ( HashMap :: new ( ) ) ,
850
850
imports : RefCell :: new ( Vec :: new ( ) ) ,
851
851
anonymous_children : RefCell :: new ( NodeMap ( ) ) ,
852
852
shadowed_traits : RefCell :: new ( Vec :: new ( ) ) ,
@@ -863,7 +863,7 @@ impl<'a> ModuleS<'a> {
863
863
let glob_count =
864
864
if allow_private_imports { self . glob_count . get ( ) } else { self . pub_glob_count . get ( ) } ;
865
865
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)
867
867
. and_then ( |binding| {
868
868
let allowed = allow_private_imports || !binding. is_import ( ) || binding. is_public ( ) ;
869
869
if allowed { Success ( binding) } else { Failed ( None ) }
@@ -873,7 +873,7 @@ impl<'a> ModuleS<'a> {
873
873
// Define the name or return the existing binding if there is a collision.
874
874
fn try_define_child ( & self , name : Name , ns : Namespace , binding : & ' a NameBinding < ' a > )
875
875
-> Result < ( ) , & ' a NameBinding < ' a > > {
876
- let mut children = self . children . borrow_mut ( ) ;
876
+ let mut children = self . resolutions . borrow_mut ( ) ;
877
877
let resolution = children. entry ( ( name, ns) ) . or_insert_with ( Default :: default) ;
878
878
879
879
// FIXME #31379: We can use methods from imported traits shadowed by non-import items
@@ -889,19 +889,19 @@ impl<'a> ModuleS<'a> {
889
889
}
890
890
891
891
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 ( ) ;
893
893
children. entry ( ( name, ns) ) . or_insert_with ( Default :: default) . outstanding_references += 1 ;
894
894
}
895
895
896
896
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 {
898
898
0 => panic ! ( "No more outstanding references!" ) ,
899
899
ref mut outstanding_references => { * outstanding_references -= 1 ; }
900
900
}
901
901
}
902
902
903
903
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 ( ) {
905
905
name_resolution. binding . map ( |binding| f ( name, ns, binding) ) ;
906
906
}
907
907
}
0 commit comments