pub(crate) enum Error<'a> {
Show 86 variants
    Unexpected(Span, ExpectedToken<'a>),
    UnexpectedComponents(Span),
    UnexpectedOperationInConstContext(Span),
    BadNumber(Span, NumberError),
    BadMatrixScalarKind(Span, Scalar),
    BadAccessor(Span),
    BadTexture(Span),
    BadTypeCast {
        span: Span,
        from_type: String,
        to_type: String,
    },
    NotStorageTexture(Span),
    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: String,
        got: String,
    },
    DeclMissingTypeAndInit(Span),
    MissingAttribute(&'static str, Span),
    InvalidAddrOfOperand(Span),
    InvalidAtomicPointer(Span),
    InvalidAtomicOperandType(Span),
    InvalidRayQueryPointer(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)]>,
    },
    InvalidSwitchSelector {
        span: Span,
    },
    InvalidSwitchCase {
        span: Span,
    },
    SwitchCaseTypeMismatch {
        span: Span,
    },
    CalledEntryPoint(Span),
    WrongArgumentCount {
        span: Span,
        expected: Range<u32>,
        found: u32,
    },
    TooManyArguments {
        function: String,
        call_span: Span,
        arg_span: Span,
        max_arguments: u32,
    },
    WrongArgumentType {
        function: String,
        call_span: Span,
        arg_span: Span,
        arg_index: u32,
        arg_ty: String,
        allowed: Vec<String>,
    },
    InconsistentArgumentType {
        function: String,
        call_span: Span,
        arg_span: Span,
        arg_index: u32,
        arg_ty: String,
        inconsistent_span: Span,
        inconsistent_index: u32,
        inconsistent_ty: String,
        allowed: Vec<String>,
    },
    FunctionReturnsVoid(Span),
    FunctionMustUseUnused(Span),
    FunctionMustUseReturnsVoid(Span, 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>,
    },
    SelectUnexpectedArgumentType {
        arg_span: Span,
        arg_type: String,
    },
    SelectRejectAndAcceptHaveNoCommonType {
        reject_span: Span,
        reject_type: String,
        accept_span: Span,
        accept_type: String,
    },
}Variants§
Unexpected(Span, ExpectedToken<'a>)
UnexpectedComponents(Span)
UnexpectedOperationInConstContext(Span)
BadNumber(Span, NumberError)
BadMatrixScalarKind(Span, Scalar)
BadAccessor(Span)
BadTexture(Span)
BadTypeCast
NotStorageTexture(Span)
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)
InvalidAddrOfOperand(Span)
InvalidAtomicPointer(Span)
InvalidAtomicOperandType(Span)
InvalidRayQueryPointer(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
InvalidSwitchSelector
InvalidSwitchCase
SwitchCaseTypeMismatch
CalledEntryPoint(Span)
WrongArgumentCount
TooManyArguments
No overload of this function accepts this many arguments.
Fields
WrongArgumentType
A value passed to a builtin function has a type that is not accepted by any overload of the function.
Fields
InconsistentArgumentType
A value passed to a builtin function has a type that is not accepted, given the earlier arguments’ types.
Fields
FunctionReturnsVoid(Span)
FunctionMustUseUnused(Span)
FunctionMustUseReturnsVoid(Span, 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
SelectUnexpectedArgumentType
SelectRejectAndAcceptHaveNoCommonType
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