pub enum CompileError {
Show 161 variants UnknownVariable { var_name: Ident, }, UnknownVariablePath { var_name: Ident, span: Span, }, UnknownFunction { name: Ident, span: Span, }, NotAVariable { name: Ident, what_it_is: &'static str, }, NotAFunction { name: CallPath, what_it_is: &'static str, }, Unimplemented(&'static strSpan), TypeError(TypeError), ParseError { span: Span, err: String, }, Internal(&'static strSpan), InternalOwned(StringSpan), InvalidByteLiteralLength { byte_length: usize, span: Span, }, ExpectedExprAfterOp { op: String, span: Span, }, ExpectedOp { op: String, span: Span, }, MultipleContracts(Span), MultipleScripts(Span), MultiplePredicates(Span), NoPredicateMainFunction(Span), PredicateMainDoesNotReturnBool(Span), NoScriptMainFunction(Span), MultipleDefinitionsOfFunction { name: Ident, }, ReassignmentToNonVariable { name: Ident, kind: &'static str, span: Span, }, AssignmentToNonMutable { name: Ident, }, MethodRequiresMutableSelf { method_name: Ident, variable_name: Ident, span: Span, }, MutableParameterNotSupported { param_name: Ident, }, ImmutableArgumentToMutableParameter { span: Span, }, RefMutableNotAllowedInContractAbi { param_name: Ident, }, AssociatedFunctionCalledAsMethod { fn_name: Ident, span: Span, }, TypeParameterNotInTypeScope { name: Ident, span: Span, comma_separated_generic_params: String, fn_name: Ident, args: String, }, MultipleImmediates(Span), MismatchedTypeInTrait { span: Span, given: String, expected: String, }, NotATrait { span: Span, name: Ident, }, UnknownTrait { span: Span, name: Ident, }, FunctionNotAPartOfInterfaceSurface { name: Ident, trait_name: Ident, span: Span, }, MissingInterfaceSurfaceMethods { missing_functions: String, span: Span, }, IncorrectNumberOfTypeArguments { given: usize, expected: usize, span: Span, }, DoesNotTakeTypeArguments { name: Ident, span: Span, }, TypeArgumentsNotAllowed { span: Span, }, NeedsTypeArguments { name: Ident, span: Span, }, StructNotFound { name: Ident, span: Span, }, EnumNotFound { name: Ident, span: Span, }, DeclaredNonStructAsStruct { name: Ident, span: Span, }, AccessedFieldOfNonStruct { field_name: Ident, name: Ident, span: Span, }, MethodOnNonValue { name: Ident, thing: Ident, span: Span, }, StructMissingField { field_name: Ident, struct_name: Ident, span: Span, }, StructDoesNotHaveField { field_name: Ident, struct_name: Ident, span: Span, }, MethodNotFound { method_name: Ident, type_name: String, }, ModuleNotFound { span: Span, name: String, }, FieldAccessOnNonStruct { actually: String, span: Span, }, NotATuple { name: String, span: Span, actually: String, }, NotAnEnum { name: String, span: Span, actually: String, }, NotAStruct { span: Span, actually: String, }, DeclIsNotAnEnum { actually: String, span: Span, }, DeclIsNotAStruct { actually: String, span: Span, }, DeclIsNotAFunction { actually: String, span: Span, }, DeclIsNotAVariable { actually: String, span: Span, }, DeclIsNotAnAbi { actually: String, span: Span, }, DeclIsNotATrait { actually: String, span: Span, }, DeclIsNotAnImplTrait { actually: String, span: Span, }, DeclIsNotATraitFn { actually: String, span: Span, }, FieldNotFound { field_name: Ident, available_fields: String, struct_name: Ident, }, SymbolNotFound { name: Ident, }, ImportPrivateSymbol { name: Ident, }, NoElseBranch { span: Span, type: String, }, UnqualifiedSelfType { span: Span, }, NotAType { span: Span, name: String, actually_is: &'static str, }, MissingEnumInstantiator { span: Span, }, PathDoesNotReturn { span: Span, ty: String, function_name: Ident, }, ExpectedImplicitReturnFromBlockWithType { span: Span, ty: String, }, ExpectedImplicitReturnFromBlock { span: Span, }, UnknownRegister { span: Span, initialized_registers: String, }, MissingImmediate { span: Span, }, InvalidImmediateValue { span: Span, }, InvalidAssemblyMismatchedReturn { span: Span, }, UnknownEnumVariant { enum_name: Ident, variant_name: Ident, span: Span, }, UnrecognizedOp { op_name: Ident, span: Span, }, UnableToInferGeneric { ty: String, span: Span, }, UnconstrainedGenericParameter { ty: String, span: Span, }, Immediate06TooLarge { val: u64, span: Span, }, Immediate12TooLarge { val: u64, span: Span, }, Immediate18TooLarge { val: u64, span: Span, }, Immediate24TooLarge { val: u64, span: Span, }, DisallowedJi { span: Span, }, DisallowedJnei { span: Span, }, DisallowedJnzi { span: Span, }, DisallowedLw { span: Span, }, IncorrectNumberOfAsmRegisters { span: Span, expected: usize, received: usize, }, UnnecessaryImmediate { span: Span, }, AmbiguousPath { span: Span, }, InvalidStrType { raw: String, span: Span, }, UnknownType { span: Span, }, UnknownTypeName { name: String, span: Span, }, TooManyInstructions { span: Span, }, FileNotFound { span: Span, file_path: String, }, FileCouldNotBeRead { span: Span, file_path: String, stringified_error: String, }, ImportMustBeLibrary { span: Span, }, MoreThanOneEnumInstantiator { span: Span, ty: String, }, UnnecessaryEnumInstantiator { span: Span, }, TraitNotFound { name: CallPath, }, InvalidExpressionOnLhs { span: Span, }, TooManyArgumentsForFunction { span: Span, method_name: Ident, expected: usize, received: usize, }, TooFewArgumentsForFunction { span: Span, method_name: Ident, expected: usize, received: usize, }, InvalidAbiType { span: Span, }, NotAnAbi { span: Span, actually_is: &'static str, }, ImplAbiForNonContract { span: Span, ty: String, }, IncorrectNumberOfInterfaceSurfaceFunctionParameters { fn_name: Ident, trait_name: Ident, num_parameters: usize, provided_parameters: usize, span: Span, }, ArgumentParameterTypeMismatch { span: Span, should_be: String, provided: String, }, RecursiveCall { fn_name: Ident, span: Span, }, RecursiveCallChain { fn_name: Ident, call_chain: String, span: Span, }, RecursiveType { name: Ident, span: Span, }, RecursiveTypeChain { name: Ident, type_chain: String, span: Span, }, TypeWithUnknownSize { span: Span, }, InfiniteDependencies { file_path: String, span: Span, }, GMFromExternalContract { span: Span, }, MintFromExternalContext { span: Span, }, BurnFromExternalContext { span: Span, }, ContractStorageFromExternalContext { span: Span, }, ArrayOutOfBounds { index: u64, count: u64, span: Span, }, TupleIndexOutOfBounds { index: usize, count: usize, span: Span, }, ShadowsOtherSymbol { name: Ident, }, GenericShadowsGeneric { name: Ident, }, StarImportShadowsOtherSymbol { name: Ident, }, MatchWrongType { expected: TypeId, span: Span, }, MatchExpressionNonExhaustive { missing_patterns: String, span: Span, }, MatchStructPatternMissingFields { missing_fields: Vec<String>, span: Span, }, StorageAccessMismatch { attrs: String, span: Span, }, TraitDeclPureImplImpure { fn_name: Ident, trait_name: Ident, attrs: String, span: Span, }, TraitImplPurityMismatch { fn_name: Ident, trait_name: Ident, attrs: String, span: Span, }, ImpureInNonContract { span: Span, }, ImpureInPureContext { storage_op: &'static str, attrs: String, span: Span, }, IntegerTooLarge { span: Span, ty: String, }, IntegerTooSmall { span: Span, ty: String, }, IntegerContainsInvalidDigit { span: Span, ty: String, }, AsteriskWithAlias { span: Span, }, AbiAsSupertrait { span: Span, }, SupertraitImplMissing { supertrait_name: CallPath, type_name: String, span: Span, }, SupertraitImplRequired { supertrait_name: CallPath, trait_name: Ident, span: Span, }, IfLetNonEnum { span: Span, }, ContractCallParamRepeated { param_name: String, span: Span, }, UnrecognizedContractParam { param_name: String, span: Span, }, CallParamForNonContractCallMethod { span: Span, }, StorageFieldDoesNotExist { name: Ident, }, NoDeclaredStorage { span: Span, }, MultipleStorageDeclarations { span: Span, }, InvalidStorageOnlyTypeDecl { ty: String, span: Span, }, InvalidVariableName { name: Ident, }, UnexpectedDeclaration { decl_type: &'static str, span: Span, }, ContractAddressMustBeKnown { span: Span, }, ConvertParseTree { error: ConvertParseTreeError, }, Lex { error: LexError, }, Parse { error: ParseError, }, WhereClauseNotYetSupported { span: Span, }, NonConstantDeclValue { span: Span, }, StorageDeclarationInNonContract { program_kind: String, span: Span, }, IntrinsicUnsupportedArgType { name: String, span: Span, hint: Hint, }, IntrinsicIncorrectNumArgs { name: String, expected: u64, span: Span, }, IntrinsicIncorrectNumTArgs { name: String, expected: u64, span: Span, }, BreakOutsideLoop { span: Span, }, ContinueOutsideLoop { span: Span, }, MainArgsNotYetSupported { span: Span, }, ConfigTimeConstantNotAConstDecl { span: Span, }, ConfigTimeConstantNotALiteral { span: Span, },
}

Variants

UnknownVariable

Fields

var_name: Ident

UnknownVariablePath

Fields

var_name: Ident
span: Span

UnknownFunction

Fields

name: Ident
span: Span

NotAVariable

Fields

name: Ident
what_it_is: &'static str

NotAFunction

Fields

name: CallPath
what_it_is: &'static str

Unimplemented(&'static strSpan)

TypeError(TypeError)

ParseError

Fields

span: Span
err: String

Internal(&'static strSpan)

InternalOwned(StringSpan)

InvalidByteLiteralLength

Fields

byte_length: usize
span: Span

ExpectedExprAfterOp

Fields

op: String
span: Span

ExpectedOp

Fields

op: String
span: Span

MultipleContracts(Span)

MultipleScripts(Span)

MultiplePredicates(Span)

NoPredicateMainFunction(Span)

PredicateMainDoesNotReturnBool(Span)

NoScriptMainFunction(Span)

MultipleDefinitionsOfFunction

Fields

name: Ident

ReassignmentToNonVariable

Fields

name: Ident
kind: &'static str
span: Span

AssignmentToNonMutable

Fields

name: Ident

MethodRequiresMutableSelf

Fields

method_name: Ident
variable_name: Ident
span: Span

MutableParameterNotSupported

Fields

param_name: Ident

ImmutableArgumentToMutableParameter

Fields

span: Span

RefMutableNotAllowedInContractAbi

Fields

param_name: Ident

AssociatedFunctionCalledAsMethod

Fields

fn_name: Ident
span: Span

TypeParameterNotInTypeScope

Fields

name: Ident
span: Span
comma_separated_generic_params: String
fn_name: Ident
args: String

MultipleImmediates(Span)

MismatchedTypeInTrait

Fields

span: Span
given: String
expected: String

NotATrait

Fields

span: Span
name: Ident

UnknownTrait

Fields

span: Span
name: Ident

FunctionNotAPartOfInterfaceSurface

Fields

name: Ident
trait_name: Ident
span: Span

MissingInterfaceSurfaceMethods

Fields

missing_functions: String
span: Span

IncorrectNumberOfTypeArguments

Fields

given: usize
expected: usize
span: Span

DoesNotTakeTypeArguments

Fields

name: Ident
span: Span

TypeArgumentsNotAllowed

Fields

span: Span

NeedsTypeArguments

Fields

name: Ident
span: Span

StructNotFound

Fields

name: Ident
span: Span

EnumNotFound

Fields

name: Ident
span: Span

DeclaredNonStructAsStruct

Fields

name: Ident
span: Span

AccessedFieldOfNonStruct

Fields

field_name: Ident
name: Ident
span: Span

MethodOnNonValue

Fields

name: Ident
thing: Ident
span: Span

StructMissingField

Fields

field_name: Ident
struct_name: Ident
span: Span

StructDoesNotHaveField

Fields

field_name: Ident
struct_name: Ident
span: Span

MethodNotFound

Fields

method_name: Ident
type_name: String

ModuleNotFound

Fields

span: Span
name: String

FieldAccessOnNonStruct

Fields

actually: String
span: Span

NotATuple

Fields

name: String
span: Span
actually: String

NotAnEnum

Fields

name: String
span: Span
actually: String

NotAStruct

Fields

span: Span
actually: String

DeclIsNotAnEnum

Fields

actually: String
span: Span

DeclIsNotAStruct

Fields

actually: String
span: Span

DeclIsNotAFunction

Fields

actually: String
span: Span

DeclIsNotAVariable

Fields

actually: String
span: Span

DeclIsNotAnAbi

Fields

actually: String
span: Span

DeclIsNotATrait

Fields

actually: String
span: Span

DeclIsNotAnImplTrait

Fields

actually: String
span: Span

DeclIsNotATraitFn

Fields

actually: String
span: Span

FieldNotFound

Fields

field_name: Ident
available_fields: String
struct_name: Ident

SymbolNotFound

Fields

name: Ident

ImportPrivateSymbol

Fields

name: Ident

NoElseBranch

Fields

span: Span
type: String

UnqualifiedSelfType

Fields

span: Span

NotAType

Fields

span: Span
name: String
actually_is: &'static str

MissingEnumInstantiator

Fields

span: Span

PathDoesNotReturn

Fields

span: Span
ty: String
function_name: Ident

ExpectedImplicitReturnFromBlockWithType

Fields

span: Span
ty: String

ExpectedImplicitReturnFromBlock

Fields

span: Span

UnknownRegister

Fields

span: Span
initialized_registers: String

MissingImmediate

Fields

span: Span

InvalidImmediateValue

Fields

span: Span

InvalidAssemblyMismatchedReturn

Fields

span: Span

UnknownEnumVariant

Fields

enum_name: Ident
variant_name: Ident
span: Span

UnrecognizedOp

Fields

op_name: Ident
span: Span

UnableToInferGeneric

Fields

ty: String
span: Span

UnconstrainedGenericParameter

Fields

ty: String
span: Span

Immediate06TooLarge

Fields

val: u64
span: Span

Immediate12TooLarge

Fields

val: u64
span: Span

Immediate18TooLarge

Fields

val: u64
span: Span

Immediate24TooLarge

Fields

val: u64
span: Span

DisallowedJi

Fields

span: Span

DisallowedJnei

Fields

span: Span

DisallowedJnzi

Fields

span: Span

DisallowedLw

Fields

span: Span

IncorrectNumberOfAsmRegisters

Fields

span: Span
expected: usize
received: usize

UnnecessaryImmediate

Fields

span: Span

AmbiguousPath

Fields

span: Span

InvalidStrType

Fields

raw: String
span: Span

UnknownType

Fields

span: Span

UnknownTypeName

Fields

name: String
span: Span

TooManyInstructions

Fields

span: Span

FileNotFound

Fields

span: Span
file_path: String

FileCouldNotBeRead

Fields

span: Span
file_path: String
stringified_error: String

ImportMustBeLibrary

Fields

span: Span

MoreThanOneEnumInstantiator

Fields

span: Span
ty: String

UnnecessaryEnumInstantiator

Fields

span: Span

TraitNotFound

Fields

name: CallPath

InvalidExpressionOnLhs

Fields

span: Span

TooManyArgumentsForFunction

Fields

span: Span
method_name: Ident
expected: usize
received: usize

TooFewArgumentsForFunction

Fields

span: Span
method_name: Ident
expected: usize
received: usize

InvalidAbiType

Fields

span: Span

NotAnAbi

Fields

span: Span
actually_is: &'static str

ImplAbiForNonContract

Fields

span: Span
ty: String

IncorrectNumberOfInterfaceSurfaceFunctionParameters

Fields

fn_name: Ident
trait_name: Ident
num_parameters: usize
provided_parameters: usize
span: Span

ArgumentParameterTypeMismatch

Fields

span: Span
should_be: String
provided: String

RecursiveCall

Fields

fn_name: Ident
span: Span

RecursiveCallChain

Fields

fn_name: Ident
call_chain: String
span: Span

RecursiveType

Fields

name: Ident
span: Span

RecursiveTypeChain

Fields

name: Ident
type_chain: String
span: Span

TypeWithUnknownSize

Fields

span: Span

InfiniteDependencies

Fields

file_path: String
span: Span

GMFromExternalContract

Fields

span: Span

MintFromExternalContext

Fields

span: Span

BurnFromExternalContext

Fields

span: Span

ContractStorageFromExternalContext

Fields

span: Span

ArrayOutOfBounds

Fields

index: u64
count: u64
span: Span

TupleIndexOutOfBounds

Fields

index: usize
count: usize
span: Span

ShadowsOtherSymbol

Fields

name: Ident

GenericShadowsGeneric

Fields

name: Ident

StarImportShadowsOtherSymbol

Fields

name: Ident

MatchWrongType

Fields

expected: TypeId
span: Span

MatchExpressionNonExhaustive

Fields

missing_patterns: String
span: Span

MatchStructPatternMissingFields

Fields

missing_fields: Vec<String>
span: Span

StorageAccessMismatch

Fields

attrs: String
span: Span

TraitDeclPureImplImpure

Fields

fn_name: Ident
trait_name: Ident
attrs: String
span: Span

TraitImplPurityMismatch

Fields

fn_name: Ident
trait_name: Ident
attrs: String
span: Span

ImpureInNonContract

Fields

span: Span

ImpureInPureContext

Fields

storage_op: &'static str
attrs: String
span: Span

IntegerTooLarge

Fields

span: Span
ty: String

IntegerTooSmall

Fields

span: Span
ty: String

IntegerContainsInvalidDigit

Fields

span: Span
ty: String

AsteriskWithAlias

Fields

span: Span

AbiAsSupertrait

Fields

span: Span

SupertraitImplMissing

Fields

supertrait_name: CallPath
type_name: String
span: Span

SupertraitImplRequired

Fields

supertrait_name: CallPath
trait_name: Ident
span: Span

IfLetNonEnum

Fields

span: Span

ContractCallParamRepeated

Fields

param_name: String
span: Span

UnrecognizedContractParam

Fields

param_name: String
span: Span

CallParamForNonContractCallMethod

Fields

span: Span

StorageFieldDoesNotExist

Fields

name: Ident

NoDeclaredStorage

Fields

span: Span

MultipleStorageDeclarations

Fields

span: Span

InvalidStorageOnlyTypeDecl

Fields

ty: String
span: Span

InvalidVariableName

Fields

name: Ident

UnexpectedDeclaration

Fields

decl_type: &'static str
span: Span

ContractAddressMustBeKnown

Fields

span: Span

ConvertParseTree

Fields

error: ConvertParseTreeError

Lex

Fields

error: LexError

Parse

Fields

error: ParseError

WhereClauseNotYetSupported

Fields

span: Span

NonConstantDeclValue

Fields

span: Span

StorageDeclarationInNonContract

Fields

program_kind: String
span: Span

IntrinsicUnsupportedArgType

Fields

name: String
span: Span
hint: Hint

IntrinsicIncorrectNumArgs

Fields

name: String
expected: u64
span: Span

IntrinsicIncorrectNumTArgs

Fields

name: String
expected: u64
span: Span

BreakOutsideLoop

Fields

span: Span

ContinueOutsideLoop

Fields

span: Span

MainArgsNotYetSupported

Fields

span: Span

ConfigTimeConstantNotAConstDecl

Fields

span: Span

ConfigTimeConstantNotALiteral

Fields

span: Span

Implementations

Returns the line and column start and end

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

👎Deprecated since 1.42.0:

use the Display impl or to_string()

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

🔬This is a nightly-only experimental API. (error_generic_member_access)

Provides type based access to context intended for error reports. Read more

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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

Returns the argument unchanged.

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

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

Calls U::from(self).

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

🔬This is a nightly-only experimental API. (provide_any)

Data providers should implement this method to provide all values they are able to provide by using demand. Read more

Should always be Self

The resulting type after obtaining ownership.

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

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

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