struct ModCollector<'a, 'db> {
def_collector: &'a mut DefCollector<'db>,
macro_depth: u32,
module_id: ModuleId,
tree_id: TreeId,
item_tree: &'db ItemTree,
mod_dir: ModDir,
}Expand description
Walks a single module, populating defs, imports and macros
Fields§
§def_collector: &'a mut DefCollector<'db>§macro_depth: u32§module_id: ModuleId§tree_id: TreeId§item_tree: &'db ItemTree§mod_dir: ModDirImplementations§
Source§impl ModCollector<'_, '_>
impl ModCollector<'_, '_>
fn collect_in_top_module(&mut self, items: &[ModItemId])
fn collect(&mut self, items: &[ModItemId], container: ItemContainerId)
fn process_macro_use_extern_crate<'a>( &mut self, extern_crate_id: ExternCrateId, macro_use_attrs: impl Iterator<Item = &'a Attr>, target_crate: Crate, )
fn collect_module( &mut self, module_ast_id: FileAstId<Mod::Source>, module: &Mod, attrs: Attrs<'_>, )
fn push_child_module( &mut self, name: Name, declaration: FileAstId<Module>, definition: Option<(EditionedFileId, bool)>, visibility: &RawVisibility, ) -> ModuleId
Sourcefn resolve_attributes(
&mut self,
attrs: Attrs<'_>,
mod_item: ModItemId,
container: ItemContainerId,
) -> Result<(), ()>
fn resolve_attributes( &mut self, attrs: Attrs<'_>, mod_item: ModItemId, container: ItemContainerId, ) -> Result<(), ()>
Resolves attributes on an item.
Returns Err when some attributes could not be resolved to builtins and have been
registered as unresolved.
If ignore_up_to is Some, attributes preceding and including that attribute will be
assumed to be resolved already.
fn collect_macro_rules( &mut self, attrs: Attrs<'_>, ast_id: FileAstId<MacroRules::Source>, mac: &MacroRules, module: ModuleId, )
fn collect_macro_def( &mut self, attrs: Attrs<'_>, ast_id: FileAstId<Macro2::Source>, mac: &Macro2, module: ModuleId, )
fn collect_macro_call( &mut self, ast_id: FileAstId<MacroCall>, macro_call: &MacroCall, container: ItemContainerId, )
fn import_all_legacy_macros(&mut self, module_id: ModuleId)
fn emit_unconfigured_diagnostic(&mut self, ast_id: ErasedAstId, cfg: &CfgExpr)
fn file_id(&self) -> HirFileId
Auto Trait Implementations§
impl<'a, 'db> !RefUnwindSafe for ModCollector<'a, 'db>
impl<'a, 'db> !Send for ModCollector<'a, 'db>
impl<'a, 'db> !Sync for ModCollector<'a, 'db>
impl<'a, 'db> !UnwindSafe for ModCollector<'a, 'db>
impl<'a, 'db> Freeze for ModCollector<'a, 'db>
impl<'a, 'db> Unpin for ModCollector<'a, 'db>
impl<'a, 'db> UnsafeUnpin for ModCollector<'a, 'db>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more