Skip to main content

LoweringDisposition

Struct LoweringDisposition 

Source
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: bool

The lowerer’s match arm calls push_item() to emit one or more non-boundary HIR items (e.g. PackageDecl, SubDecl, CallExpr).

§may_emit_boundary: bool

The 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: bool

The 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: bool

The lowerer records facts into side-graphs (scope bindings, stash slots, compile-environment directives, prototype table, …) without necessarily emitting a HIR item.

§is_intentional: bool

true 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 str

Human-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

Source

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):

  1. emits_itemsLowered
  2. !emits_items && may_emit_boundaryDynamicBoundary
  3. !emits_items && !may_emit_boundary && is_intentionalIntentionallySkipped
  4. !emits_items && !may_emit_boundary && !is_intentionalNotYetModeled

Trait Implementations§

Source§

impl Clone for LoweringDisposition

Source§

fn clone(&self) -> LoweringDisposition

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LoweringDisposition

Source§

impl Debug for LoweringDisposition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for LoweringDisposition

Source§

impl PartialEq for LoweringDisposition

Source§

fn eq(&self, other: &LoweringDisposition) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for LoweringDisposition

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more