pub enum LabelOrNode<S = ()> {
Label(Box<str>),
Node(Box<str>),
Expr(Expression<S>),
}Expand description
A branch/call target that may be a label, an unresolved name, or an expression.
S is the span type: (usize, usize) at parse time, () in the stored/runtime form.
Variants§
Label(Box<str>)
A label declared elsewhere in the same body: goto <loopstart>.
Control flow within one instruction’s p-code. The matching
AstNode::Label carries the same name. Names are scoped per spliced
body, so two macro expansions in one instruction cannot collide.
Node(Box<str>)
A name the compiler could not resolve to a value. One reaching a consumer means the destination could not be worked out.
Expr(Expression<S>)
A computed destination: an address, or a value to branch through.
Implementations§
Source§impl<S> LabelOrNode<S>
impl<S> LabelOrNode<S>
Sourcepub fn strip_span(self) -> LabelOrNode<()>
pub fn strip_span(self) -> LabelOrNode<()>
Discards source spans.
Trait Implementations§
Source§impl<S: Clone> Clone for LabelOrNode<S>
impl<S: Clone> Clone for LabelOrNode<S>
Source§fn clone(&self) -> LabelOrNode<S>
fn clone(&self) -> LabelOrNode<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: Debug> Debug for LabelOrNode<S>
impl<S: Debug> Debug for LabelOrNode<S>
Source§impl<'de, S> Deserialize<'de> for LabelOrNode<S>where
S: Deserialize<'de>,
impl<'de, S> Deserialize<'de> for LabelOrNode<S>where
S: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<S: Eq> Eq for LabelOrNode<S>
Source§impl<S: PartialEq> PartialEq for LabelOrNode<S>
impl<S: PartialEq> PartialEq for LabelOrNode<S>
Source§impl<S> Serialize for LabelOrNode<S>where
S: Serialize,
impl<S> Serialize for LabelOrNode<S>where
S: Serialize,
impl<S: PartialEq> StructuralPartialEq for LabelOrNode<S>
Auto Trait Implementations§
impl<S> Freeze for LabelOrNode<S>where
Expression<S>: Freeze,
impl<S> RefUnwindSafe for LabelOrNode<S>where
Expression<S>: RefUnwindSafe,
impl<S> Send for LabelOrNode<S>where
Expression<S>: Send,
impl<S> Sync for LabelOrNode<S>where
Expression<S>: Sync,
impl<S> Unpin for LabelOrNode<S>where
Expression<S>: Unpin,
impl<S> UnsafeUnpin for LabelOrNode<S>where
Expression<S>: UnsafeUnpin,
impl<S> UnwindSafe for LabelOrNode<S>where
Expression<S>: UnwindSafe,
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
Mutably borrows from an owned value. Read more