## ExpressionId

# Struct ExpressionId

Source

    pub struct ExpressionId {
        private_use_as_methods_instead: u32,
    }

Expand description

ID of a coverage-counter expression. Values ascend from 0.

Before MIR inlining, expression IDs are local to their enclosing function. After MIR inlining, coverage statements may have been inlined into another function, so use the statement’s source-scope to find which function/instance its IDs are meaningful for.

Note that LLVM handles expression IDs as `uint32_t`, so there is no need to use a larger representation on the Rust side.

## Fields§

§`private_use_as_methods_instead: u32`

## Implementations§

Source§

### impl ExpressionId

Source

#### pub const MAX_AS_U32: u32 = 4_294_967_040u32

Maximum value the index can take, as a `u32`.

Source

#### pub const MAX: Self

Maximum value the index can take.

Source

#### pub const ZERO: Self

Zero value of the index.

Source

#### pub const fn from_usize(value: usize) -> Self

Creates a new index from a given `usize`.

##### §Panics

Will panic if `value` exceeds `MAX`.

Source

#### pub const fn from_u32(value: u32) -> Self

Creates a new index from a given `u32`.

##### §Panics

Will panic if `value` exceeds `MAX`.

Source

#### pub const fn from_u16(value: u16) -> Self

Creates a new index from a given `u16`.

##### §Panics

Will panic if `value` exceeds `MAX`.

Source

#### pub const unsafe fn from_u32_unchecked(value: u32) -> Self

Creates a new index from a given `u32`.

##### §Safety

The provided value must be less than or equal to the maximum value for the newtype. Providing a value outside this range is undefined due to layout restrictions.

Prefer using `from_u32`.

Source

#### pub const fn index(self) -> usize

Extracts the value of this index as a `usize`.

Source

#### pub const fn as_u32(self) -> u32

Extracts the value of this index as a `u32`.

Source

#### pub const fn as_usize(self) -> usize

Extracts the value of this index as a `usize`.

## Trait Implementations§

Source§

### impl Add<usize> for ExpressionId

Source§

#### type Output = ExpressionId

The resulting type after applying the `+` operator.
Source§

#### fn add(self, other: usize) -> Self

Performs the `+` operation. Read more
Source§

### impl AddAssign<usize> for ExpressionId

Source§

#### fn add_assign(&mut self, other: usize)

Performs the `+=` operation. Read more
Source§

### impl Clone for ExpressionId

Source§

#### fn clone(&self) -> ExpressionId

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from `source`. Read more
Source§

### impl Debug for ExpressionId

Source§

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

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

### impl<D: Decoder> Decodable<D> for ExpressionId

Source§

#### fn decode(d: &mut D) -> Self

Source§

### impl<E: Encoder> Encodable<E> for ExpressionId

Source§

#### fn encode(&self, e: &mut E)

Source§

### impl From<ExpressionId> for u32

Source§

#### fn from(v: ExpressionId) -> u32

Converts to this type from the input type.
Source§

### impl From<ExpressionId> for usize

Source§

#### fn from(v: ExpressionId) -> usize

Converts to this type from the input type.
Source§

### impl From<u32> for ExpressionId

Source§

#### fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

### impl From<usize> for ExpressionId

Source§

#### fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

### impl Hash for ExpressionId

Source§

#### fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given `Hasher`. Read more
1.3.0§

#### fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given `Hasher`. Read more
Source§

### impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for ExpressionId

Source§

#### fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher, )

Source§

### impl Idx for ExpressionId

Source§

#### fn new(value: usize) -> Self

Source§

#### fn index(self) -> usize

§

#### fn increment_by(&mut self, amount: usize)

§

#### fn plus(self, amount: usize) -> Self

Source§

### impl Ord for ExpressionId

Source§

#### fn cmp(&self, other: &ExpressionId) -> Ordering

This method returns an `Ordering` between `self` and `other`. Read more
1.21.0§

#### fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

#### fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

#### fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

### impl PartialEq for ExpressionId

Source§

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

Tests for `self` and `other` values to be equal, and is used by `==`.
1.0.0§

#### 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 PartialOrd for ExpressionId

Source§

#### fn partial_cmp(&self, other: &ExpressionId) -> Option<Ordering>

This method returns an ordering between `self` and `other` values if one exists. Read more
1.0.0§

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

Tests less than (for `self` and `other`) and is used by the `<` operator. Read more
1.0.0§

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

Tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more
1.0.0§

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

Tests greater than (for `self` and `other`) and is used by the `>` operator. Read more
1.0.0§

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

Tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more
Source§

### impl Step for ExpressionId

Source§

#### fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>)

🔬This is a nightly-only experimental API. (`step_trait`)
Returns the bounds on the number of successor steps required to get from `start` to `end` like `Iterator::size_hint()`. Read more
Source§

#### fn forward_checked(start: Self, u: usize) -> Option<Self>

🔬This is a nightly-only experimental API. (`step_trait`)
Returns the value that would be obtained by taking the successor of `self` `count` times. Read more
Source§

#### fn backward_checked(start: Self, u: usize) -> Option<Self>

🔬This is a nightly-only experimental API. (`step_trait`)
Returns the value that would be obtained by taking the predecessor of `self` `count` times. Read more
§

#### fn forward(start: Self, count: usize) -> Self

🔬This is a nightly-only experimental API. (`step_trait`)
Returns the value that would be obtained by taking the successor of `self` `count` times. Read more
§

#### unsafe fn forward_unchecked(start: Self, count: usize) -> Self

🔬This is a nightly-only experimental API. (`step_trait`)
Returns the value that would be obtained by taking the successor of `self` `count` times. Read more
§

#### fn backward(start: Self, count: usize) -> Self

🔬This is a nightly-only experimental API. (`step_trait`)
Returns the value that would be obtained by taking the predecessor of `self` `count` times. Read more
§

#### unsafe fn backward_unchecked(start: Self, count: usize) -> Self

🔬This is a nightly-only experimental API. (`step_trait`)
Returns the value that would be obtained by taking the predecessor of `self` `count` times. Read more
Source§

### impl Copy for ExpressionId

Source§

### impl Eq for ExpressionId

Source§

### impl StructuralPartialEq for ExpressionId

## Auto Trait Implementations§

§

### impl DynSend for ExpressionId

§

### impl DynSync for ExpressionId

§

### impl Freeze for ExpressionId

§

### impl RefUnwindSafe for ExpressionId

§

### impl Send for ExpressionId

§

### impl Sync for ExpressionId

§

### impl Unpin for ExpressionId

§

### impl UnwindSafe for ExpressionId

## Blanket Implementations§

§

### impl<T> Aligned for T

§

#### const ALIGN: Alignment

Alignment of `Self`.
§

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

§

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
§

### impl<T> AnyEq for T
where T: Any + PartialEq,

§

#### fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

#### fn as_any(&self) -> &(dyn Any + 'static)

Source§

### impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for T
where T: Copy,

Source§

#### fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T

Source§

#### fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]

§

### impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for T
where T: Copy,

§

#### fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T

§

#### fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]

§

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

§

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

#### 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
§

### impl<T, R> CollectAndApply<T, R> for T

§

#### fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to `f(&iter.collect::<Vec<_>>())`.

§

#### type Output = R

§

### impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

#### fn compare(&self, key: &K) -> Ordering

Compare self to `key` and return their ordering.
§

### impl<Tcx, T> DepNodeParams<Tcx> for T
where Tcx: DepContext, T: for<'a> HashStable<StableHashingContext<'a>> + Debug,

§

#### default fn fingerprint_style() -> FingerprintStyle

§

#### default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint

This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous).
§

#### default fn to_debug_str(&self, tcx: Tcx) -> String

§

#### default fn recover(_: Tcx, _: &DepNode) -> Option<T>

This method tries to recover the query key from the given `DepNode`, something which is needed when forcing `DepNode`s during red-green evaluation. The query system will only call this method if `fingerprint_style()` is not `FingerprintStyle::Opaque`. It is always valid to return `None` here, in which case incremental compilation will treat the query as having changed instead of forcing it.
§

### impl<T> DynClone for T
where T: Clone,

§

#### fn __clone_box(&self, _: Private) -> *mut ()

§

### impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

#### fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

### impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

#### fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

### impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

#### fn equivalent(&self, key: &K) -> bool

Compare self to `key` and return `true` if they are equal.
§

### impl<T> From<T> for T

§

#### fn from(t: T) -> T

Returns the argument unchanged.

§

### impl<T> Instrument for T

§

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

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

#### fn in_current_span(self) -> Instrumented<Self>

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

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

§

#### fn into(self) -> U

Calls `U::from(self)`.

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

§

### impl<T> IntoEither for T

§

#### fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts `self` into a `Left` variant of `Either<Self, Self>` if `into_left` is `true`. Converts `self` into a `Right` variant of `Either<Self, Self>` otherwise. Read more
§

#### fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts `self` into a `Left` variant of `Either<Self, Self>` if `into_left(&self)` returns `true`. Converts `self` into a `Right` variant of `Either<Self, Self>` otherwise. Read more
Source§

### impl<P> IntoQueryParam<P> for P

Source§

#### fn into_query_param(self) -> P

§

### impl<I, T> IntoSliceIdx<I, [T]> for I
where I: Idx,

§

#### type Output = usize

§

#### fn into_slice_idx(self) -> <I as IntoSliceIdx<I, [T]>>::Output

Source§

### impl<T> MaybeResult<T> for T

Source§

#### type Error = !

Source§

#### fn from(_: Result<T, <T as MaybeResult<T>>::Error>) -> T

Source§

#### fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>

§

### impl<T> Pointable for T

§

#### const ALIGN: usize

The alignment of pointer.
§

#### type Init = T

The type for initializers.
§

#### unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

#### unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

#### unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

#### unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

### impl<T> Same for T

§

#### type Output = T

Should always be `Self`
§

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

§

#### type Owned = T

The resulting type after obtaining ownership.
§

#### fn to_owned(&self) -> T

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

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

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

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

§

#### type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
§

### impl<I, T, U> Upcast<I, U> for T
where U: UpcastFrom<I, T>,

§

#### fn upcast(self, interner: I) -> U

§

### impl<I, T> UpcastFrom<I, T> for T

§

#### fn upcast_from(from: T, _tcx: I) -> T

§

### impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

#### fn vzip(self) -> V

§

### impl<Tcx, T> Value<Tcx> for T
where Tcx: DepContext,

§

#### default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T

§

### impl<T> WithSubscriber for T

§

#### 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
§

#### fn with_current_subscriber(self) -> WithDispatch<Self>

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

### impl<T> ErasedDestructor for T
where T: 'static,

## Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain `repr(...)` attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 4 bytes