Trait rustc_resolve::ResolverAstLowering[−][src]

pub(crate) trait ResolverAstLowering {
Show 16 methods fn def_key(&mut self, id: DefId) -> DefKey;
fn def_span(&self, id: LocalDefId) -> Span;
fn item_generics_num_lifetimes(&self, def: DefId) -> usize;
fn legacy_const_generic_args(
        &mut self,
        expr: &Expr
    ) -> Option<Vec<usize, Global>>;
fn get_partial_res(&self, id: NodeId) -> Option<PartialRes>;
fn get_import_res(&mut self, id: NodeId) -> PerNS<Option<Res<NodeId>>>;
fn get_label_res(&mut self, id: NodeId) -> Option<NodeId>;
fn definitions(&mut self) -> &mut Definitions;
fn create_stable_hashing_context(&self) -> StableHashingContext<'_>;
fn lint_buffer(&mut self) -> &mut LintBuffer;
fn next_node_id(&mut self) -> NodeId;
fn take_trait_map(
        &mut self,
        node: NodeId
    ) -> Option<Vec<TraitCandidate, Global>>;
fn opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId>;
fn local_def_id(&self, node: NodeId) -> LocalDefId;
fn def_path_hash(&self, def_id: DefId) -> DefPathHash;
fn create_def(
        &mut self,
        parent: LocalDefId,
        node_id: NodeId,
        data: DefPathData,
        expn_id: ExpnId,
        span: Span
    ) -> LocalDefId;
}

Required methods

Obtains resolution for a NodeId with a single resolution.

Obtains per-namespace resolutions for use statement with the given NodeId.

Obtains resolution for a label with the given NodeId.

We must keep the set of definitions up to date as we add nodes that weren’t in the AST. This should only return None during testing.

Implementors

This interface is used through the AST→HIR step, to embed full paths into the HIR. After that the resolver is no longer needed as all the relevant information is inline.