Enum sway_core::error::CompileError
source · [−]pub enum CompileError {
Show 110 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 str, Span),
PatternMatchingAlgorithmFailure(&'static str, Span),
TypeError(TypeError),
ParseFailure {
span: Span,
err: Error<Rule>,
},
InvalidTopLevelItem(Rule, Span),
Internal(&'static str, Span),
InternalOwned(String, Span),
UnimplementedRule(Rule, Span),
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(String, Span),
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: Ident,
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,
},
InvalidNumberOfAbiParams {
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,
},
AbiFunctionRequiresSpecificSignature {
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,
},
ShadowsOtherSymbol {
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,
},
}
Variants
UnknownVariable
UnknownVariablePath
UnknownFunction
NotAVariable
NotAFunction
Unimplemented(&'static str, Span)
PatternMatchingAlgorithmFailure(&'static str, Span)
TypeError(TypeError)
ParseFailure
InvalidTopLevelItem(Rule, Span)
Internal(&'static str, Span)
InternalOwned(String, Span)
UnimplementedRule(Rule, Span)
InvalidByteLiteralLength
ExpectedExprAfterOp
ExpectedOp
UnexpectedWhereClause(Span)
UndeclaredGenericTypeInWhereClause
MultipleContracts(Span)
MultipleScripts(Span)
MultiplePredicates(Span)
ConstrainedNonExistentType
MultiplePredicateMainFunctions(Span)
NoPredicateMainFunction(Span)
PredicateMainDoesNotReturnBool(Span)
NoScriptMainFunction(Span)
MultipleScriptMainFunctions(Span)
ReassignmentToNonVariable
AssignmentToNonMutable(String, Span)
TypeParameterNotInTypeScope
MultipleImmediates(Span)
MismatchedTypeInTrait
NotATrait
UnknownTrait
FunctionNotAPartOfInterfaceSurface
MissingInterfaceSurfaceMethods
IncorrectNumberOfTypeArguments
StructNotFound
DeclaredNonStructAsStruct
AccessedFieldOfNonStruct
MethodOnNonValue
StructMissingField
StructDoesNotHaveField
MethodNotFound
ModuleNotFound
NotAStruct
NotATuple
NotAnEnum
FieldNotFound
SymbolNotFound
ImportPrivateSymbol
NoElseBranch
UnqualifiedSelfType
Fields
span: Span
NotAType
MissingEnumInstantiator
Fields
span: Span
PathDoesNotReturn
ExpectedImplicitReturnFromBlockWithType
ExpectedImplicitReturnFromBlock
Fields
span: Span
UnknownRegister
MissingImmediate
Fields
span: Span
InvalidImmediateValue
Fields
span: Span
InvalidAssemblyMismatchedReturn
Fields
span: Span
UnknownEnumVariant
UnrecognizedOp
TypeMustBeKnown
Immediate06TooLarge
Immediate12TooLarge
Immediate18TooLarge
Immediate24TooLarge
DisallowedJnei
Fields
span: Span
DisallowedJi
Fields
span: Span
DisallowedLw
Fields
span: Span
IncorrectNumberOfAsmRegisters
UnnecessaryImmediate
Fields
span: Span
AmbiguousPath
Fields
span: Span
InvalidStrType
UnknownType
Fields
span: Span
TooManyInstructions
Fields
span: Span
FileNotFound
FileCouldNotBeRead
ImportMustBeLibrary
Fields
span: Span
MoreThanOneEnumInstantiator
UnnecessaryEnumInstantiator
Fields
span: Span
TraitNotFound
InvalidExpressionOnLhs
Fields
span: Span
TooManyArgumentsForFunction
TooFewArgumentsForFunction
InvalidAbiType
Fields
span: Span
InvalidNumberOfAbiParams
Fields
span: Span
NotAnAbi
ImplAbiForNonContract
IncorrectNumberOfInterfaceSurfaceFunctionParameters
AbiFunctionRequiresSpecificSignature
Fields
span: Span
ArgumentParameterTypeMismatch
RecursiveCall
RecursiveCallChain
TypeWithUnknownSize
Fields
span: Span
InfiniteDependencies
GMFromExternalContract
Fields
span: Span
MintFromExternalContext
Fields
span: Span
BurnFromExternalContext
Fields
span: Span
ContractStorageFromExternalContext
Fields
span: Span
ArrayOutOfBounds
ShadowsOtherSymbol
MatchWrongType
PureCalledImpure
Fields
span: Span
ImpureInNonContract
Fields
span: Span
IntegerTooLarge
IntegerTooSmall
IntegerContainsInvalidDigit
Implementations
Trait Implementations
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for CompileError
impl Send for CompileError
impl Sync for CompileError
impl Unpin for CompileError
impl UnwindSafe for CompileError
Blanket Implementations
Mutably borrows from an owned value. Read more