@@ -774,7 +774,7 @@ enum ModuleKind {
774
774
}
775
775
776
776
/// One node in the tree of modules.
777
- pub struct ModuleS < ' a > {
777
+ pub struct ModuleData < ' a > {
778
778
parent : Option < Module < ' a > > ,
779
779
kind : ModuleKind ,
780
780
@@ -802,11 +802,11 @@ pub struct ModuleS<'a> {
802
802
populated : Cell < bool > ,
803
803
}
804
804
805
- pub type Module < ' a > = & ' a ModuleS < ' a > ;
805
+ pub type Module < ' a > = & ' a ModuleData < ' a > ;
806
806
807
- impl < ' a > ModuleS < ' a > {
807
+ impl < ' a > ModuleData < ' a > {
808
808
fn new ( parent : Option < Module < ' a > > , kind : ModuleKind ) -> Self {
809
- ModuleS {
809
+ ModuleData {
810
810
parent : parent,
811
811
kind : kind,
812
812
normal_ancestor_id : None ,
@@ -859,7 +859,7 @@ impl<'a> ModuleS<'a> {
859
859
}
860
860
}
861
861
862
- impl < ' a > fmt:: Debug for ModuleS < ' a > {
862
+ impl < ' a > fmt:: Debug for ModuleData < ' a > {
863
863
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
864
864
write ! ( f, "{:?}" , self . def( ) )
865
865
}
@@ -1116,7 +1116,7 @@ pub struct Resolver<'a> {
1116
1116
}
1117
1117
1118
1118
pub struct ResolverArenas < ' a > {
1119
- modules : arena:: TypedArena < ModuleS < ' a > > ,
1119
+ modules : arena:: TypedArena < ModuleData < ' a > > ,
1120
1120
local_modules : RefCell < Vec < Module < ' a > > > ,
1121
1121
name_bindings : arena:: TypedArena < NameBinding < ' a > > ,
1122
1122
import_directives : arena:: TypedArena < ImportDirective < ' a > > ,
@@ -1126,7 +1126,7 @@ pub struct ResolverArenas<'a> {
1126
1126
}
1127
1127
1128
1128
impl < ' a > ResolverArenas < ' a > {
1129
- fn alloc_module ( & ' a self , module : ModuleS < ' a > ) -> Module < ' a > {
1129
+ fn alloc_module ( & ' a self , module : ModuleData < ' a > ) -> Module < ' a > {
1130
1130
let module = self . modules . alloc ( module) ;
1131
1131
if module. def_id ( ) . map ( |def_id| def_id. is_local ( ) ) . unwrap_or ( true ) {
1132
1132
self . local_modules . borrow_mut ( ) . push ( module) ;
@@ -1206,10 +1206,10 @@ impl<'a> Resolver<'a> {
1206
1206
arenas : & ' a ResolverArenas < ' a > )
1207
1207
-> Resolver < ' a > {
1208
1208
let root_def = Def :: Mod ( DefId :: local ( CRATE_DEF_INDEX ) ) ;
1209
- let graph_root = arenas. alloc_module ( ModuleS {
1209
+ let graph_root = arenas. alloc_module ( ModuleData {
1210
1210
normal_ancestor_id : Some ( CRATE_NODE_ID ) ,
1211
1211
no_implicit_prelude : attr:: contains_name ( & krate. attrs , "no_implicit_prelude" ) ,
1212
- ..ModuleS :: new ( None , ModuleKind :: Def ( root_def, keywords:: Invalid . name ( ) ) )
1212
+ ..ModuleData :: new ( None , ModuleKind :: Def ( root_def, keywords:: Invalid . name ( ) ) )
1213
1213
} ) ;
1214
1214
let mut module_map = NodeMap ( ) ;
1215
1215
module_map. insert ( CRATE_NODE_ID , graph_root) ;
@@ -1327,17 +1327,17 @@ impl<'a> Resolver<'a> {
1327
1327
}
1328
1328
1329
1329
fn new_module ( & self , parent : Module < ' a > , kind : ModuleKind , local : bool ) -> Module < ' a > {
1330
- self . arenas . alloc_module ( ModuleS {
1330
+ self . arenas . alloc_module ( ModuleData {
1331
1331
normal_ancestor_id : if local { self . current_module . normal_ancestor_id } else { None } ,
1332
1332
populated : Cell :: new ( local) ,
1333
- ..ModuleS :: new ( Some ( parent) , kind)
1333
+ ..ModuleData :: new ( Some ( parent) , kind)
1334
1334
} )
1335
1335
}
1336
1336
1337
1337
fn record_use ( & mut self , ident : Ident , ns : Namespace , binding : & ' a NameBinding < ' a > , span : Span )
1338
1338
-> bool /* true if an error was reported */ {
1339
1339
// track extern crates for unused_extern_crate lint
1340
- if let Some ( DefId { krate, .. } ) = binding. module ( ) . and_then ( ModuleS :: def_id) {
1340
+ if let Some ( DefId { krate, .. } ) = binding. module ( ) . and_then ( ModuleData :: def_id) {
1341
1341
self . used_crates . insert ( krate) ;
1342
1342
}
1343
1343
@@ -2403,7 +2403,7 @@ impl<'a> Resolver<'a> {
2403
2403
} ) ;
2404
2404
}
2405
2405
}
2406
- let msg = if module. and_then ( ModuleS :: def) == self . graph_root . def ( ) {
2406
+ let msg = if module. and_then ( ModuleData :: def) == self . graph_root . def ( ) {
2407
2407
let is_mod = |def| match def { Def :: Mod ( ..) => true , _ => false } ;
2408
2408
let mut candidates =
2409
2409
self . lookup_candidates ( ident. name , TypeNS , is_mod) . candidates ;
0 commit comments