Skip to main content

ExpectedFailKeyPart

Enum ExpectedFailKeyPart 

Source
pub enum ExpectedFailKeyPart {
    Named {
        index: IndexTypeRef,
        variant: IndexVariantName,
        source_index_path: Option<NamePath>,
        span: Span,
    },
    RangeStep {
        step: u64,
        span: Span,
    },
}
Expand description

One axis segment in a per-variant #[expected_fail(...)] key.

Variants§

§

Named

An Index.Variant / module.Index.Variant segment for a named axis.

The index carrier is the semantic key used by runtime assertion checks. Before module-aware TIR resolution, source_index_path preserves the structured syntax path. After resolution, index carries the canonical owner used by runtime checks.

Fields

§source_index_path: Option<NamePath>
§span: Span
§

RangeStep

A #N segment for a Nat range axis (#816).

Range axes have no source-level index name, so the axis identity is positional: the segment binds to the assertion’s axis at the same tuple position, validated at dim-check time.

Fields

§step: u64
§span: Span

Implementations§

Source§

impl ExpectedFailKeyPart

Source

pub fn unresolved( index_path: NamePath, variant: IndexVariantName, span: Span, ) -> Self

Source

pub fn with_owner( owner: DagId, index: IndexName, variant: IndexVariantName, span: Span, ) -> Self

Source

pub fn resolved(resolved: ResolvedIndexVariant, span: Span) -> Self

Source

pub fn with_resolved_variant(&self, resolved: ResolvedIndexVariant) -> Self

Source

pub const fn span(&self) -> Span

The source span of this key segment.

Source

pub const fn named_index(&self) -> Option<&IndexTypeRef>

The named index reference, when this segment targets a named axis.

Source

pub const fn source_index_path(&self) -> Option<&NamePath>

The structured syntax path awaiting resolution, for named segments.

Source

pub fn variant(&self) -> IndexVariantName

The variant key this segment selects within its axis.

Source

pub fn matches_entry( &self, index: &IndexTypeRef, variant: &IndexVariantName, ) -> bool

Whether this segment selects the given entry of an indexed value.

Named segments require the entry’s index identity to match; #N segments match the #N entry of any Nat range axis (the axis itself was bound positionally at dim-check time).

Source

pub fn display(&self) -> String

Render this segment for diagnostics: Index.Variant or #N.

Trait Implementations§

Source§

impl Clone for ExpectedFailKeyPart

Source§

fn clone(&self) -> ExpectedFailKeyPart

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 ExpectedFailKeyPart

Source§

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

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

impl Eq for ExpectedFailKeyPart

Source§

impl PartialEq for ExpectedFailKeyPart

Source§

fn eq(&self, other: &ExpectedFailKeyPart) -> 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 ExpectedFailKeyPart

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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

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

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

Source§

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

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

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

Source§

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

Checks if this value is equivalent to the given key. Read more
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 = 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.