Skip to main content

Ident

Enum Ident 

Source
pub enum Ident {
    Named(LocalVarId),
    Register(RegisterId),
    BitRange(BitRangeFieldId),
    Field(FieldId),
    Table(TableId),
    Global(Box<str>),
}
Expand description

A named thing a p-code expression refers to.

Everything but Ident::Global is fully resolved: by the time an instruction’s AST reaches a consumer, a name has become an index into the compiled specification. Look identifiers up through the producer’s specification table — its register table for a RegisterId, bit-range table for a bit-range field, and so on.

Variants§

§

Named(LocalVarId)

A temporary declared inside a constructor or macro body — local x:4, or an assignment to a name that was never declared. Unique within one decoded instruction; see LocalVarId.

§

Register(RegisterId)

A machine register, as named by define register.

§

BitRange(BitRangeFieldId)

A named sub-range of a register, as named by define bitrange. The producer’s bit-range table gives the parent register and byte window.

§

Field(FieldId)

A token, context or global field. In an emitted instruction this is normally already folded to a constant; one surviving here means the decode could not supply a value for it.

§

Table(TableId)

A sub-table operand. One surviving in an emitted instruction means its sub-constructor exported nothing.

§

Global(Box<str>)

An identifier absent from the symbol table during Phase 2 parsing. Resolved to the appropriate variant by the Phase 3 resolve pass.

Trait Implementations§

Source§

impl Clone for Ident

Source§

fn clone(&self) -> Ident

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 Debug for Ident

Source§

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

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

impl<'de> Deserialize<'de> for Ident

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Ident

Source§

impl PartialEq for Ident

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Ident

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Ident

Auto Trait Implementations§

§

impl Freeze for Ident

§

impl RefUnwindSafe for Ident

§

impl Send for Ident

§

impl Sync for Ident

§

impl Unpin for Ident

§

impl UnsafeUnpin for Ident

§

impl UnwindSafe for Ident

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.