@@ -456,28 +456,36 @@ struct BindingKey {
456
456
type Resolutions < ' a > = RefCell < FxIndexMap < BindingKey , & ' a RefCell < NameResolution < ' a > > > > ;
457
457
458
458
/// One node in the tree of modules.
459
+ ///
460
+ /// Note that "module" is a loose term here; it does not necessarily mean
461
+ /// a `mod` that you declare in Rust code. It may also be, e.g., a trait
462
+ /// or an enum. See [`ModuleKind`] (accessible through [`ModuleData::kind`]
463
+ /// for all of the kinds of "modules" that resolve deals with.
459
464
pub struct ModuleData < ' a > {
465
+ /// The direct parent module (it may not be a `mod`, however).
460
466
parent : Option < Module < ' a > > ,
467
+ /// What kind of module this is, because this may not be a `mod`.
461
468
kind : ModuleKind ,
462
469
463
- // The def id of the closest normal module ( `mod`) ancestor (including this module).
470
+ /// The [`DefId`] of the closest `mod` item ancestor (which may be this module), including crate root .
464
471
normal_ancestor_id : DefId ,
465
472
466
- // Mapping between names and their (possibly in-progress) resolutions in this module.
467
- // Resolutions in modules from other crates are not populated until accessed.
473
+ /// Mapping between names and their (possibly in-progress) resolutions in this module.
474
+ /// Resolutions in modules from other crates are not populated until accessed.
468
475
lazy_resolutions : Resolutions < ' a > ,
469
- // True if this is a module from other crate that needs to be populated on access.
476
+ /// True if this is a module from other crate that needs to be populated on access.
470
477
populate_on_access : Cell < bool > ,
471
478
472
- // Macro invocations that can expand into items in this module.
479
+ /// Macro invocations that can expand into items in this module.
473
480
unexpanded_invocations : RefCell < FxHashSet < ExpnId > > ,
474
481
482
+ /// Whether `#[no_implicit_prelude]` is active.
475
483
no_implicit_prelude : bool ,
476
484
477
485
glob_importers : RefCell < Vec < & ' a Import < ' a > > > ,
478
486
globs : RefCell < Vec < & ' a Import < ' a > > > ,
479
487
480
- // Used to memoize the traits in this module for faster searches through all traits in scope.
488
+ /// Used to memoize the traits in this module for faster searches through all traits in scope.
481
489
traits : RefCell < Option < Box < [ ( Ident , & ' a NameBinding < ' a > ) ] > > > ,
482
490
483
491
/// Span of the module itself. Used for error reporting.
0 commit comments