Enum naga::front::wgsl::error::Error

source ·
pub(crate) enum Error<'a> {
Show 76 variants Unexpected(Span, ExpectedToken<'a>), UnexpectedComponents(Span), UnexpectedOperationInConstContext(Span), BadNumber(Span, NumberError), BadMatrixScalarKind(Span, Scalar), BadAccessor(Span), BadTexture(Span), BadTypeCast { span: Span, from_type: Box<str>, to_type: Box<str>, }, BadTextureSampleType { span: Span, scalar: Scalar, }, BadIncrDecrReferenceType(Span), InvalidResolve(ResolveError), InvalidForInitializer(Span), InvalidBreakIf(Span), InvalidGatherComponent(Span), InvalidConstructorComponentType(Span, i32), InvalidIdentifierUnderscore(Span), ReservedIdentifierPrefix(Span), UnknownAddressSpace(Span), RepeatedAttribute(Span), UnknownAttribute(Span), UnknownBuiltin(Span), UnknownAccess(Span), UnknownIdent(Span, &'a str), UnknownScalarType(Span), UnknownType(Span), UnknownStorageFormat(Span), UnknownConservativeDepth(Span), UnknownEnableExtension(Span, &'a str), UnknownLanguageExtension(Span, &'a str), UnknownDiagnosticRuleName(Span), SizeAttributeTooLow(Span, u32), AlignAttributeTooLow(Span, Alignment), NonPowerOfTwoAlignAttribute(Span), InconsistentBinding(Span), TypeNotConstructible(Span), TypeNotInferable(Span), InitializationTypeMismatch { name: Span, expected: Box<str>, got: Box<str>, }, DeclMissingTypeAndInit(Span), MissingAttribute(&'static str, Span), InvalidAtomicPointer(Span), InvalidAtomicOperandType(Span), InvalidRayQueryPointer(Span), Pointer(&'static str, Span), NotPointer(Span), NotReference(&'static str, Span), InvalidAssignment { span: Span, ty: InvalidAssignmentType, }, ReservedKeyword(Span), Redefinition { previous: Span, current: Span, }, RecursiveDeclaration { ident: Span, usage: Span, }, CyclicDeclaration { ident: Span, path: Box<[(Span, Span)]>, }, InvalidSwitchValue { uint: bool, span: Span, }, CalledEntryPoint(Span), WrongArgumentCount { span: Span, expected: Range<u32>, found: u32, }, FunctionReturnsVoid(Span), InvalidWorkGroupUniformLoad(Span), Internal(&'static str), ExpectedConstExprConcreteIntegerScalar(Span), ExpectedNonNegative(Span), ExpectedPositiveArrayLength(Span), MissingWorkgroupSize(Span), ConstantEvaluatorError(Box<ConstantEvaluatorError>, Span), AutoConversion(Box<AutoConversionError>), AutoConversionLeafScalar(Box<AutoConversionLeafScalarError>), ConcretizationFailed(Box<ConcretizationFailedError>), ExceededLimitForNestedBraces { span: Span, limit: u8, }, PipelineConstantIDValue(Span), NotBool(Span), ConstAssertFailed(Span), DirectiveAfterFirstGlobalDecl { directive_span: Span, }, EnableExtensionNotYetImplemented { kind: UnimplementedEnableExtension, span: Span, }, EnableExtensionNotEnabled { kind: EnableExtension, span: Span, }, LanguageExtensionNotYetImplemented { kind: UnimplementedLanguageExtension, span: Span, }, DiagnosticInvalidSeverity { severity_control_name_span: Span, }, DiagnosticDuplicateTriggeringRule(ConflictingDiagnosticRuleError), DiagnosticAttributeNotYetImplementedAtParseSite { site_name_plural: &'static str, spans: Vec<Span>, }, DiagnosticAttributeNotSupported { on_what: DiagnosticAttributeNotSupportedPosition, spans: Vec<Span>, },
}

Variants§

§

Unexpected(Span, ExpectedToken<'a>)

§

UnexpectedComponents(Span)

§

UnexpectedOperationInConstContext(Span)

§

BadNumber(Span, NumberError)

§

BadMatrixScalarKind(Span, Scalar)

§

BadAccessor(Span)

§

BadTexture(Span)

§

BadTypeCast

Fields

§span: Span
§from_type: Box<str>
§to_type: Box<str>
§

BadTextureSampleType

Fields

§span: Span
§scalar: Scalar
§

BadIncrDecrReferenceType(Span)

§

InvalidResolve(ResolveError)

§

InvalidForInitializer(Span)

§

InvalidBreakIf(Span)

A break if appeared outside of a continuing block

§

InvalidGatherComponent(Span)

§

InvalidConstructorComponentType(Span, i32)

§

InvalidIdentifierUnderscore(Span)

§

ReservedIdentifierPrefix(Span)

§

UnknownAddressSpace(Span)

§

RepeatedAttribute(Span)

§

UnknownAttribute(Span)

§

UnknownBuiltin(Span)

§

UnknownAccess(Span)

§

UnknownIdent(Span, &'a str)

§

UnknownScalarType(Span)

§

UnknownType(Span)

§

UnknownStorageFormat(Span)

§

UnknownConservativeDepth(Span)

§

UnknownEnableExtension(Span, &'a str)

§

UnknownLanguageExtension(Span, &'a str)

§

UnknownDiagnosticRuleName(Span)

§

SizeAttributeTooLow(Span, u32)

§

AlignAttributeTooLow(Span, Alignment)

§

NonPowerOfTwoAlignAttribute(Span)

§

InconsistentBinding(Span)

§

TypeNotConstructible(Span)

§

TypeNotInferable(Span)

§

InitializationTypeMismatch

Fields

§name: Span
§expected: Box<str>
§got: Box<str>
§

DeclMissingTypeAndInit(Span)

§

MissingAttribute(&'static str, Span)

§

InvalidAtomicPointer(Span)

§

InvalidAtomicOperandType(Span)

§

InvalidRayQueryPointer(Span)

§

Pointer(&'static str, Span)

§

NotPointer(Span)

§

NotReference(&'static str, Span)

§

InvalidAssignment

§

ReservedKeyword(Span)

§

Redefinition

Redefinition of an identifier (used for both module-scope and local redefinitions).

Fields

§previous: Span

Span of the identifier in the previous definition.

§current: Span

Span of the identifier in the new definition.

§

RecursiveDeclaration

A declaration refers to itself directly.

Fields

§ident: Span

The location of the name of the declaration.

§usage: Span

The point at which it is used.

§

CyclicDeclaration

A declaration refers to itself indirectly, through one or more other definitions.

Fields

§ident: Span

The location of the name of some declaration in the cycle.

§path: Box<[(Span, Span)]>

The edges of the cycle of references.

Each (decl, reference) pair indicates that the declaration whose name is decl has an identifier at reference whose definition is the next declaration in the cycle. The last pair’s reference is the same identifier as ident, above.

§

InvalidSwitchValue

Fields

§uint: bool
§span: Span
§

CalledEntryPoint(Span)

§

WrongArgumentCount

Fields

§span: Span
§expected: Range<u32>
§found: u32
§

FunctionReturnsVoid(Span)

§

InvalidWorkGroupUniformLoad(Span)

§

Internal(&'static str)

§

ExpectedConstExprConcreteIntegerScalar(Span)

§

ExpectedNonNegative(Span)

§

ExpectedPositiveArrayLength(Span)

§

MissingWorkgroupSize(Span)

§

ConstantEvaluatorError(Box<ConstantEvaluatorError>, Span)

§

AutoConversion(Box<AutoConversionError>)

§

AutoConversionLeafScalar(Box<AutoConversionLeafScalarError>)

§

ConcretizationFailed(Box<ConcretizationFailedError>)

§

ExceededLimitForNestedBraces

Fields

§span: Span
§limit: u8
§

PipelineConstantIDValue(Span)

§

NotBool(Span)

§

ConstAssertFailed(Span)

§

DirectiveAfterFirstGlobalDecl

Fields

§directive_span: Span
§

EnableExtensionNotYetImplemented

§

EnableExtensionNotEnabled

Fields

§span: Span
§

LanguageExtensionNotYetImplemented

§

DiagnosticInvalidSeverity

Fields

§severity_control_name_span: Span
§

DiagnosticDuplicateTriggeringRule(ConflictingDiagnosticRuleError)

§

DiagnosticAttributeNotYetImplementedAtParseSite

Fields

§site_name_plural: &'static str
§spans: Vec<Span>
§

DiagnosticAttributeNotSupported

Implementations§

source§

impl<'a> Error<'a>

source

pub(crate) fn as_parse_error(&self, source: &'a str) -> ParseError

Trait Implementations§

source§

impl<'a> Clone for Error<'a>

source§

fn clone(&self) -> Error<'a>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for Error<'a>

source§

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

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

impl From<ConflictingDiagnosticRuleError> for Error<'_>

source§

fn from(value: ConflictingDiagnosticRuleError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for Error<'a>

§

impl<'a> RefUnwindSafe for Error<'a>

§

impl<'a> Send for Error<'a>

§

impl<'a> Sync for Error<'a>

§

impl<'a> Unpin for Error<'a>

§

impl<'a> UnwindSafe for Error<'a>

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.