Enum sway_core::error::CompileError [−][src]
pub enum CompileError<'sc> {
Show 105 variants
UnknownVariable {
var_name: String,
span: Span<'sc>,
},
UnknownVariablePath {
var_name: &'sc str,
span: Span<'sc>,
},
UnknownFunction {
name: &'sc str,
span: Span<'sc>,
},
NotAVariable {
name: String,
span: Span<'sc>,
what_it_is: &'static str,
},
NotAFunction {
name: String,
span: Span<'sc>,
what_it_is: &'static str,
},
Unimplemented(&'static str, Span<'sc>),
PatternMatchingAlgorithmFailure(&'static str, Span<'sc>),
TypeError(TypeError<'sc>),
ParseFailure {
span: Span<'sc>,
err: Error<Rule>,
},
InvalidTopLevelItem(Rule, Span<'sc>),
Internal(&'static str, Span<'sc>),
UnimplementedRule(Rule, Span<'sc>),
InvalidByteLiteralLength {
byte_length: usize,
span: Span<'sc>,
},
ExpectedExprAfterOp {
op: &'sc str,
span: Span<'sc>,
},
ExpectedOp {
op: &'sc str,
span: Span<'sc>,
},
UnexpectedWhereClause(Span<'sc>),
UndeclaredGenericTypeInWhereClause {
type_name: &'sc str,
span: Span<'sc>,
},
MultipleContracts(Span<'sc>),
MultipleScripts(Span<'sc>),
MultiplePredicates(Span<'sc>),
ConstrainedNonExistentType {
trait_name: &'sc str,
type_name: &'sc str,
span: Span<'sc>,
},
MultiplePredicateMainFunctions(Span<'sc>),
NoPredicateMainFunction(Span<'sc>),
PredicateMainDoesNotReturnBool(Span<'sc>),
NoScriptMainFunction(Span<'sc>),
MultipleScriptMainFunctions(Span<'sc>),
ReassignmentToNonVariable {
name: &'sc str,
kind: &'sc str,
span: Span<'sc>,
},
AssignmentToNonMutable(String, Span<'sc>),
TypeParameterNotInTypeScope {
name: String,
span: Span<'sc>,
comma_separated_generic_params: String,
fn_name: &'sc str,
args: String,
},
MultipleImmediates(Span<'sc>),
MismatchedTypeInTrait {
span: Span<'sc>,
given: String,
expected: String,
},
NotATrait {
span: Span<'sc>,
name: &'sc str,
},
UnknownTrait {
span: Span<'sc>,
name: &'sc str,
},
FunctionNotAPartOfInterfaceSurface {
name: &'sc str,
trait_name: String,
span: Span<'sc>,
},
MissingInterfaceSurfaceMethods {
missing_functions: String,
span: Span<'sc>,
},
IncorrectNumberOfTypeArguments {
given: usize,
expected: usize,
span: Span<'sc>,
},
StructNotFound {
name: &'sc str,
span: Span<'sc>,
},
DeclaredNonStructAsStruct {
name: &'sc str,
span: Span<'sc>,
},
AccessedFieldOfNonStruct {
field_name: &'sc str,
name: &'sc str,
span: Span<'sc>,
},
MethodOnNonValue {
name: &'sc str,
thing: &'sc str,
span: Span<'sc>,
},
StructMissingField {
field_name: &'sc str,
struct_name: &'sc str,
span: Span<'sc>,
},
StructDoesNotHaveField {
field_name: &'sc str,
struct_name: &'sc str,
span: Span<'sc>,
},
MethodNotFound {
span: Span<'sc>,
method_name: String,
type_name: String,
},
NonFinalAsteriskInPath {
span: Span<'sc>,
},
ModuleNotFound {
span: Span<'sc>,
name: String,
},
NotAStruct {
name: String,
span: Span<'sc>,
actually: String,
},
NotAnEnum {
name: String,
span: Span<'sc>,
actually: String,
},
FieldNotFound {
field_name: &'sc str,
available_fields: String,
struct_name: String,
span: Span<'sc>,
},
SymbolNotFound {
span: Span<'sc>,
name: String,
},
ImportPrivateSymbol {
span: Span<'sc>,
name: String,
},
NoElseBranch {
span: Span<'sc>,
type: String,
},
UnqualifiedSelfType {
span: Span<'sc>,
},
NotAType {
span: Span<'sc>,
name: String,
actually_is: &'sc str,
},
MissingEnumInstantiator {
span: Span<'sc>,
},
PathDoesNotReturn {
span: Span<'sc>,
ty: String,
function_name: &'sc str,
},
ExpectedImplicitReturnFromBlockWithType {
span: Span<'sc>,
ty: String,
},
ExpectedImplicitReturnFromBlock {
span: Span<'sc>,
},
UnknownRegister {
span: Span<'sc>,
initialized_registers: String,
},
MissingImmediate {
span: Span<'sc>,
},
InvalidImmediateValue {
span: Span<'sc>,
},
InvalidAssemblyMismatchedReturn {
span: Span<'sc>,
},
UnknownEnumVariant {
enum_name: &'sc str,
variant_name: &'sc str,
span: Span<'sc>,
},
UnrecognizedOp {
op_name: &'sc str,
span: Span<'sc>,
},
TypeMustBeKnown {
ty: String,
span: Span<'sc>,
},
Immediate06TooLarge {
val: u64,
span: Span<'sc>,
},
Immediate12TooLarge {
val: u64,
span: Span<'sc>,
},
Immediate18TooLarge {
val: u64,
span: Span<'sc>,
},
Immediate24TooLarge {
val: u64,
span: Span<'sc>,
},
DisallowedJnei {
span: Span<'sc>,
},
DisallowedJi {
span: Span<'sc>,
},
DisallowedLw {
span: Span<'sc>,
},
IncorrectNumberOfAsmRegisters {
span: Span<'sc>,
expected: usize,
received: usize,
},
UnnecessaryImmediate {
span: Span<'sc>,
},
AmbiguousPath {
span: Span<'sc>,
},
InvalidStrType {
raw: String,
span: Span<'sc>,
},
UnknownType {
span: Span<'sc>,
},
TooManyInstructions {
span: Span<'sc>,
},
FileNotFound {
span: Span<'sc>,
file_path: String,
},
FileCouldNotBeRead {
span: Span<'sc>,
file_path: String,
stringified_error: String,
},
ImportMustBeLibrary {
span: Span<'sc>,
},
MoreThanOneEnumInstantiator {
span: Span<'sc>,
ty: String,
},
UnnecessaryEnumInstantiator {
span: Span<'sc>,
},
TraitNotFound {
name: &'sc str,
span: Span<'sc>,
},
InvalidExpressionOnLhs {
span: Span<'sc>,
},
TooManyArgumentsForFunction {
span: Span<'sc>,
method_name: &'sc str,
expected: usize,
received: usize,
},
TooFewArgumentsForFunction {
span: Span<'sc>,
method_name: &'sc str,
expected: usize,
received: usize,
},
InvalidAbiType {
span: Span<'sc>,
},
InvalidNumberOfAbiParams {
span: Span<'sc>,
},
NotAnAbi {
span: Span<'sc>,
actually_is: &'static str,
},
ImplAbiForNonContract {
span: Span<'sc>,
ty: String,
},
IncorrectNumberOfInterfaceSurfaceFunctionParameters {
fn_name: &'sc str,
trait_name: &'sc str,
num_args: usize,
provided_args: usize,
span: Span<'sc>,
},
AbiFunctionRequiresSpecificSignature {
span: Span<'sc>,
},
ArgumentParameterTypeMismatch {
span: Span<'sc>,
should_be: String,
provided: String,
},
RecursiveCall {
fn_name: &'sc str,
span: Span<'sc>,
},
RecursiveCallChain {
fn_name: &'sc str,
call_chain: String,
span: Span<'sc>,
},
TypeWithUnknownSize {
span: Span<'sc>,
},
InfiniteDependencies {
file_path: String,
span: Span<'sc>,
},
GMFromExternalContract {
span: Span<'sc>,
},
MintFromExternalContext {
span: Span<'sc>,
},
BurnFromExternalContext {
span: Span<'sc>,
},
ContractStorageFromExternalContext {
span: Span<'sc>,
},
ArrayOutOfBounds {
index: u64,
count: u64,
span: Span<'sc>,
},
MatchWrongType {
expected: usize,
span: Span<'sc>,
},
PureCalledImpure {
span: Span<'sc>,
},
ImpureInNonContract {
span: Span<'sc>,
},
}
Variants
UnknownVariable
UnknownVariablePath
UnknownFunction
NotAVariable
NotAFunction
Unimplemented(&'static str, Span<'sc>)
PatternMatchingAlgorithmFailure(&'static str, Span<'sc>)
TypeError(TypeError<'sc>)
Tuple Fields
0: TypeError<'sc>
ParseFailure
InvalidTopLevelItem(Rule, Span<'sc>)
Internal(&'static str, Span<'sc>)
UnimplementedRule(Rule, Span<'sc>)
InvalidByteLiteralLength
ExpectedExprAfterOp
ExpectedOp
UnexpectedWhereClause(Span<'sc>)
Tuple Fields
0: Span<'sc>
UndeclaredGenericTypeInWhereClause
MultipleContracts(Span<'sc>)
Tuple Fields
0: Span<'sc>
MultipleScripts(Span<'sc>)
Tuple Fields
0: Span<'sc>
MultiplePredicates(Span<'sc>)
Tuple Fields
0: Span<'sc>
ConstrainedNonExistentType
MultiplePredicateMainFunctions(Span<'sc>)
Tuple Fields
0: Span<'sc>
NoPredicateMainFunction(Span<'sc>)
Tuple Fields
0: Span<'sc>
PredicateMainDoesNotReturnBool(Span<'sc>)
Tuple Fields
0: Span<'sc>
NoScriptMainFunction(Span<'sc>)
Tuple Fields
0: Span<'sc>
MultipleScriptMainFunctions(Span<'sc>)
Tuple Fields
0: Span<'sc>
ReassignmentToNonVariable
AssignmentToNonMutable(String, Span<'sc>)
TypeParameterNotInTypeScope
Fields
name: String
span: Span<'sc>
comma_separated_generic_params: String
fn_name: &'sc str
args: String
MultipleImmediates(Span<'sc>)
Tuple Fields
0: Span<'sc>
MismatchedTypeInTrait
NotATrait
UnknownTrait
FunctionNotAPartOfInterfaceSurface
MissingInterfaceSurfaceMethods
IncorrectNumberOfTypeArguments
StructNotFound
DeclaredNonStructAsStruct
AccessedFieldOfNonStruct
MethodOnNonValue
StructMissingField
StructDoesNotHaveField
MethodNotFound
NonFinalAsteriskInPath
Fields
span: Span<'sc>
ModuleNotFound
NotAStruct
NotAnEnum
FieldNotFound
SymbolNotFound
ImportPrivateSymbol
NoElseBranch
UnqualifiedSelfType
Fields
span: Span<'sc>
NotAType
MissingEnumInstantiator
Fields
span: Span<'sc>
PathDoesNotReturn
ExpectedImplicitReturnFromBlockWithType
ExpectedImplicitReturnFromBlock
Fields
span: Span<'sc>
UnknownRegister
MissingImmediate
Fields
span: Span<'sc>
InvalidImmediateValue
Fields
span: Span<'sc>
InvalidAssemblyMismatchedReturn
Fields
span: Span<'sc>
UnknownEnumVariant
UnrecognizedOp
TypeMustBeKnown
Immediate06TooLarge
Immediate12TooLarge
Immediate18TooLarge
Immediate24TooLarge
DisallowedJnei
Fields
span: Span<'sc>
DisallowedJi
Fields
span: Span<'sc>
DisallowedLw
Fields
span: Span<'sc>
IncorrectNumberOfAsmRegisters
UnnecessaryImmediate
Fields
span: Span<'sc>
AmbiguousPath
Fields
span: Span<'sc>
InvalidStrType
UnknownType
Fields
span: Span<'sc>
TooManyInstructions
Fields
span: Span<'sc>
FileNotFound
FileCouldNotBeRead
ImportMustBeLibrary
Fields
span: Span<'sc>
MoreThanOneEnumInstantiator
UnnecessaryEnumInstantiator
Fields
span: Span<'sc>
TraitNotFound
InvalidExpressionOnLhs
Fields
span: Span<'sc>
TooManyArgumentsForFunction
TooFewArgumentsForFunction
InvalidAbiType
Fields
span: Span<'sc>
InvalidNumberOfAbiParams
Fields
span: Span<'sc>
NotAnAbi
ImplAbiForNonContract
IncorrectNumberOfInterfaceSurfaceFunctionParameters
AbiFunctionRequiresSpecificSignature
Fields
span: Span<'sc>
ArgumentParameterTypeMismatch
RecursiveCall
RecursiveCallChain
TypeWithUnknownSize
Fields
span: Span<'sc>
InfiniteDependencies
GMFromExternalContract
Fields
span: Span<'sc>
MintFromExternalContext
Fields
span: Span<'sc>
BurnFromExternalContext
Fields
span: Span<'sc>
ContractStorageFromExternalContext
Fields
span: Span<'sc>
ArrayOutOfBounds
MatchWrongType
PureCalledImpure
Fields
span: Span<'sc>
ImpureInNonContract
Fields
span: Span<'sc>
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<'sc> RefUnwindSafe for CompileError<'sc>
impl<'sc> Send for CompileError<'sc>
impl<'sc> Sync for CompileError<'sc>
impl<'sc> Unpin for CompileError<'sc>
impl<'sc> UnwindSafe for CompileError<'sc>
Blanket Implementations
Mutably borrows from an owned value. Read more