pub struct ArmPath { /* private fields */ }Expand description
The conditionals enclosing a unit, outermost first.
Empty for the overwhelming majority of units, which sit under no conditional at all, and empty for every Rust unit.
Implementations§
Source§impl ArmPath
impl ArmPath
Sourcepub fn descend(&self, node: &IrNode, next: &mut u32) -> Option<Self>
pub fn descend(&self, node: &IrNode, next: &mut u32) -> Option<Self>
The path that applies inside node, or None when node leaves it
unchanged — which is every node but a conditional’s own.
next hands out conditional identifiers and must be shared across
every file in a run, so that two files’ conditionals never collide.
Arms nest rather than sit side by side: the grammar puts a #elif and
its #else inside the arm they follow, so entering one continues the
conditional already open instead of starting another. A conditional the
parser stumbled inside is entered too — it has to be, or a #else
under it would advance the arm of the conditional above — but it is
entered unbelieved, and none of its arms is distinguished from another.
Sourcepub fn excludes(&self, other: &Self) -> bool
pub fn excludes(&self, other: &Self) -> bool
Whether the two units can never both be part of one build.
True when the paths agree down to some conditional and then take different arms of it. Diverging on different conditionals says nothing: those are two independent guards, and both can hold. An unbelieved conditional never separates anything: its arms all carry the same index, so two units under it agree there and the comparison continues into whatever nests below.
Sourcepub fn is_unreachable(&self) -> bool
pub fn is_unreachable(&self) -> bool
Whether this path contains code no build can reach without evaluating an unknown condition.
Trait Implementations§
impl Eq for ArmPath
impl StructuralPartialEq for ArmPath
Auto Trait Implementations§
impl Freeze for ArmPath
impl RefUnwindSafe for ArmPath
impl Send for ArmPath
impl Sync for ArmPath
impl Unpin for ArmPath
impl UnsafeUnpin for ArmPath
impl UnwindSafe for ArmPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.