pub enum CompileError {
Show 119 variants UnknownVariable { var_name: String, span: Span, }, UnknownVariablePath { var_name: Ident, span: Span, }, UnknownFunction { name: Ident, span: Span, }, NotAVariable { name: String, span: Span, what_it_is: &'static str, }, NotAFunction { name: String, span: Span, what_it_is: &'static str, }, Unimplemented(&'static strSpan), PatternMatchingAlgorithmFailure(&'static strSpan), TypeError(TypeError), ParseFailure { span: Span, err: Error<Rule>, }, ParseError { span: Span, err: String, }, InvalidTopLevelItem(RuleSpan), Internal(&'static strSpan), InternalOwned(StringSpan), UnimplementedRule(RuleSpan), InvalidByteLiteralLength { byte_length: usize, span: Span, }, ExpectedExprAfterOp { op: String, span: Span, }, ExpectedOp { op: String, span: Span, }, UnexpectedWhereClause(Span), UndeclaredGenericTypeInWhereClause { type_name: Ident, span: Span, }, MultipleContracts(Span), MultipleScripts(Span), MultiplePredicates(Span), ConstrainedNonExistentType { trait_name: Ident, type_name: Ident, span: Span, }, MultiplePredicateMainFunctions(Span), NoPredicateMainFunction(Span), PredicateMainDoesNotReturnBool(Span), NoScriptMainFunction(Span), MultipleScriptMainFunctions(Span), ReassignmentToNonVariable { name: Ident, kind: &'static str, span: Span, }, AssignmentToNonMutable(StringSpan), TypeParameterNotInTypeScope { name: String, 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, }, StructNotFound { 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 { span: Span, method_name: String, type_name: String, }, ModuleNotFound { span: Span, name: String, }, NotAStruct { name: String, span: Span, actually: String, }, NotATuple { name: String, span: Span, actually: String, }, NotAnEnum { name: String, span: Span, actually: String, }, FieldNotFound { field_name: Ident, available_fields: String, struct_name: String, span: Span, }, SymbolNotFound { span: Span, name: String, }, ImportPrivateSymbol { span: Span, name: String, }, 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, }, TypeMustBeKnown { ty: String, span: Span, }, Immediate06TooLarge { val: u64, span: Span, }, Immediate12TooLarge { val: u64, span: Span, }, Immediate18TooLarge { val: u64, span: Span, }, Immediate24TooLarge { val: u64, span: Span, }, DisallowedJnei { span: Span, }, DisallowedJi { 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, }, 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: String, span: Span, }, 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_args: usize, provided_args: 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, }, 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, }, TupleOutOfBounds { index: usize, count: usize, span: Span, }, ShadowsOtherSymbol { name: String, span: Span, }, StarImportShadowsOtherSymbol { name: String, span: Span, }, MatchWrongType { expected: TypeId, span: Span, }, PureCalledImpure { span: Span, }, ImpureInNonContract { span: Span, }, IntegerTooLarge { span: Span, ty: String, }, IntegerTooSmall { span: Span, ty: String, }, IntegerContainsInvalidDigit { span: Span, ty: String, }, AsteriskWithAlias { span: Span, }, AbiAsSupertrait { span: Span, }, NameDefinedMultipleTimesForTrait { fn_name: String, trait_name: String, span: Span, }, SupertraitImplMissing { supertrait_name: String, type_name: String, span: Span, }, SupertraitImplRequired { supertrait_name: String, trait_name: String, span: Span, }, ContractCallParamRepeated { param_name: String, span: Span, }, UnrecognizedContractParam { param_name: String, span: Span, }, CallParamForNonContractCallMethod { span: Span, },
}

Variants

UnknownVariable

Fields

var_name: String
span: Span

UnknownVariablePath

Fields

var_name: Ident
span: Span

UnknownFunction

Fields

name: Ident
span: Span

NotAVariable

Fields

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

NotAFunction

Fields

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

Unimplemented(&'static strSpan)

PatternMatchingAlgorithmFailure(&'static strSpan)

TypeError(TypeError)

ParseFailure

Fields

span: Span
err: Error<Rule>

ParseError

Fields

span: Span
err: String

InvalidTopLevelItem(RuleSpan)

Internal(&'static strSpan)

InternalOwned(StringSpan)

UnimplementedRule(RuleSpan)

InvalidByteLiteralLength

Fields

byte_length: usize
span: Span

ExpectedExprAfterOp

Fields

op: String
span: Span

ExpectedOp

Fields

op: String
span: Span

UnexpectedWhereClause(Span)

UndeclaredGenericTypeInWhereClause

Fields

type_name: Ident
span: Span

MultipleContracts(Span)

MultipleScripts(Span)

MultiplePredicates(Span)

ConstrainedNonExistentType

Fields

trait_name: Ident
type_name: Ident
span: Span

MultiplePredicateMainFunctions(Span)

NoPredicateMainFunction(Span)

PredicateMainDoesNotReturnBool(Span)

NoScriptMainFunction(Span)

MultipleScriptMainFunctions(Span)

ReassignmentToNonVariable

Fields

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

AssignmentToNonMutable(StringSpan)

TypeParameterNotInTypeScope

Fields

name: String
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

StructNotFound

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

span: Span
method_name: String
type_name: String

ModuleNotFound

Fields

span: Span
name: String

NotAStruct

Fields

name: String
span: Span
actually: String

NotATuple

Fields

name: String
span: Span
actually: String

NotAnEnum

Fields

name: String
span: Span
actually: String

FieldNotFound

Fields

field_name: Ident
available_fields: String
struct_name: String
span: Span

SymbolNotFound

Fields

span: Span
name: String

ImportPrivateSymbol

Fields

span: Span
name: String

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

TypeMustBeKnown

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

DisallowedJnei

Fields

span: Span

DisallowedJi

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

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: String
span: Span

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_args: usize
provided_args: 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

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

TupleOutOfBounds

Fields

index: usize
count: usize
span: Span

ShadowsOtherSymbol

Fields

name: String
span: Span

StarImportShadowsOtherSymbol

Fields

name: String
span: Span

MatchWrongType

Fields

expected: TypeId
span: Span

PureCalledImpure

Fields

span: Span

ImpureInNonContract

Fields

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

NameDefinedMultipleTimesForTrait

Fields

fn_name: String
trait_name: String
span: Span

SupertraitImplMissing

Fields

supertrait_name: String
type_name: String
span: Span

SupertraitImplRequired

Fields

supertrait_name: String
trait_name: String
span: Span

ContractCallParamRepeated

Fields

param_name: String
span: Span

UnrecognizedContractParam

Fields

param_name: String
span: Span

CallParamForNonContractCallMethod

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

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

Returns a stack backtrace, if available, of where this error occurred. 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

Performs the conversion.

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 !=.

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

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

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

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.