pub struct LoweringDisposition {
pub emits_items: bool,
pub may_emit_boundary: bool,
pub traverses_children: bool,
pub records_side_facts: bool,
pub is_intentional: bool,
pub note: &'static str,
}Expand description
Multi-axis lowering disposition for a single AST NodeKind.
Each flag is independent; a node can simultaneously emit HIR items, emit dynamic-boundary markers, traverse children, and record side-facts.
The authoritative description of a node’s behavior is the lowerer source
in hir/lower.rs; this registry mirrors that behavior and is validated by
the hir-coverage xtask and the hir_lowering_completeness_tests.
Fields§
§emits_items: boolThe lowerer’s match arm calls push_item() to emit one or more non-boundary
HIR items (e.g. PackageDecl, SubDecl, CallExpr).
may_emit_boundary: boolThe lowerer’s match arm may call push_item(DynamicBoundary(…)) — either
unconditionally or on a runtime condition (e.g. Eval when block is not a
block literal, Unary when symbolic-ref deref is detected).
traverses_children: boolThe lowerer traverses the node’s children (via visit_children or manual
child iteration), allowing nested constructs to produce their own HIR items.
records_side_facts: boolThe lowerer records facts into side-graphs (scope bindings, stash slots, compile-environment directives, prototype table, …) without necessarily emitting a HIR item.
is_intentional: booltrue when the lowering disposition for this kind is intentionally
decided — either because lower.rs has a named match arm, or because
the node is deliberately traversal-only (e.g. ExpressionStatement) even
if it falls to _ => visit_children as a simplification.
false means the node genuinely falls to _ => visit_children without
a conscious design decision — i.e. it is “not yet modeled.”
Used by [legacy_category] to distinguish IntentionallySkipped from
NotYetModeled.
note: &'static strHuman-readable note describing the lowering behavior. Used in the generated
docs/project/status/hir_lowering.md and in test failure messages.
Implementations§
Source§impl LoweringDisposition
impl LoweringDisposition
Sourcepub fn legacy_category(self) -> LegacyCategory
pub fn legacy_category(self) -> LegacyCategory
Derive the legacy four-category classification from the multi-axis flags.
This mapping is used by hir_coverage.rs to produce backward-compatible
status-doc tables.
Derivation rules (in priority order):
emits_items→Lowered!emits_items && may_emit_boundary→DynamicBoundary!emits_items && !may_emit_boundary && is_intentional→IntentionallySkipped!emits_items && !may_emit_boundary && !is_intentional→NotYetModeled
Trait Implementations§
Source§impl Clone for LoweringDisposition
impl Clone for LoweringDisposition
Source§fn clone(&self) -> LoweringDisposition
fn clone(&self) -> LoweringDisposition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LoweringDisposition
Source§impl Debug for LoweringDisposition
impl Debug for LoweringDisposition
impl Eq for LoweringDisposition
Source§impl PartialEq for LoweringDisposition
impl PartialEq for LoweringDisposition
Source§fn eq(&self, other: &LoweringDisposition) -> bool
fn eq(&self, other: &LoweringDisposition) -> bool
self and other values to be equal, and is used by ==.