pub enum Capability {
Types,
NameResolution,
CallTargets,
MirCfg,
MacroExpansion,
TemplateInstantiation,
}Expand description
Something a helper can be asked for.
A helper reports the subset it can supply during the handshake, and a run
asks for nothing outside that subset. The variants are the information
kinds semantic analysis is built from; a helper that offers fewer is not
broken, it is less capable, and Capability::absence says what that costs.
Variants§
Types
Resolved types for expressions and bindings.
NameResolution
Which definition each name refers to, and whether it is outside the scanned code.
CallTargets
Resolved call targets.
MirCfg
A control-flow graph built from the compiler’s own.
MacroExpansion
Macro expansion with both spelling and expansion locations.
TemplateInstantiation
Template or generic instantiation traced to its definition.
Implementations§
Source§impl Capability
impl Capability
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
Stable lowercase identifier, the same spelling this serializes as.
Sourcepub const fn absence(self) -> Absence
pub const fn absence(self) -> Absence
What its absence costs.
Two are load-bearing, for the same reason stated twice. Semantic mode exists to answer with what the compiler knows rather than with what the text looks like: without resolved types a run reports syntactic findings under a semantic label, and without name resolution it decides which names to compare on by guessing from their spelling, which is the structural answer wearing the same stronger name.
Everything else refines an answer those two make possible in the first place, so missing any of them narrows the result rather than misnaming it.
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more