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
BadTextureSampleType
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
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
RecursiveDeclaration
A declaration refers to itself directly.
Fields
CyclicDeclaration
A declaration refers to itself indirectly, through one or more other definitions.
Fields
InvalidSwitchValue
CalledEntryPoint(Span)
WrongArgumentCount
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
PipelineConstantIDValue(Span)
NotBool(Span)
ConstAssertFailed(Span)
DirectiveAfterFirstGlobalDecl
EnableExtensionNotYetImplemented
EnableExtensionNotEnabled
LanguageExtensionNotYetImplemented
DiagnosticInvalidSeverity
DiagnosticDuplicateTriggeringRule(ConflictingDiagnosticRuleError)
DiagnosticAttributeNotYetImplementedAtParseSite
DiagnosticAttributeNotSupported
Implementations§
source§impl<'a> Error<'a>
impl<'a> Error<'a>
pub(crate) fn as_parse_error(&self, source: &'a str) -> ParseError
Trait Implementations§
source§impl From<ConflictingDiagnosticRuleError> for Error<'_>
impl From<ConflictingDiagnosticRuleError> for Error<'_>
source§fn from(value: ConflictingDiagnosticRuleError) -> Self
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> 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)