Enum sway_error::error::CompileError
source · pub enum CompileError {
Show 201 variants
ModuleDepGraphEvaluationError {},
ModuleDepGraphCyclicReference {
modules: Vec<BaseIdent>,
},
UnknownVariable {
var_name: Ident,
span: Span,
},
NotAVariable {
name: Ident,
what_it_is: &'static str,
span: Span,
},
Unimplemented {
feature: String,
help: Vec<String>,
span: Span,
},
TypeError(TypeError),
ParseError {
span: Span,
err: String,
},
Internal(&'static str, Span),
InternalOwned(String, Span),
NoPredicateMainFunction(Span),
PredicateMainDoesNotReturnBool(Span),
NoScriptMainFunction(Span),
MultipleDefinitionsOfFallbackFunction {
name: Ident,
span: Span,
},
MultipleDefinitionsOfFunction {
name: Ident,
span: Span,
},
MultipleDefinitionsOfName {
name: Ident,
span: Span,
},
MultipleDefinitionsOfConstant {
name: Ident,
span: Span,
},
MultipleDefinitionsOfType {
name: Ident,
span: Span,
},
MultipleDefinitionsOfMatchArmVariable {
match_value: Span,
match_type: String,
first_definition: Span,
first_definition_is_struct_field: bool,
duplicate: Span,
duplicate_is_struct_field: bool,
},
AssignmentToNonMutableVariable {
decl_name: Ident,
lhs_span: Span,
},
AssignmentToConstantOrConfigurable {
decl_name: Ident,
is_configurable: bool,
lhs_span: Span,
},
DeclAssignmentTargetCannotBeAssignedTo {
decl_name: Option<Ident>,
decl_friendly_type_name: &'static str,
lhs_span: Span,
},
AssignmentViaNonMutableReference {
decl_reference_name: Option<Ident>,
decl_reference_rhs: Option<Span>,
decl_reference_type: String,
span: Span,
},
MethodRequiresMutableSelf {
method_name: Ident,
variable_name: Ident,
span: Span,
},
MutableParameterNotSupported {
param_name: Ident,
span: Span,
},
ImmutableArgumentToMutableParameter {
span: Span,
},
RefMutableNotAllowedInContractAbi {
param_name: Ident,
span: Span,
},
RefMutCannotReferenceConstant {
constant: String,
span: Span,
},
RefMutCannotReferenceImmutableVariable {
decl_name: Ident,
span: Span,
},
AssociatedFunctionCalledAsMethod {
fn_name: Ident,
span: Span,
},
TypeParameterNotInTypeScope {
name: Ident,
span: Span,
comma_separated_generic_params: String,
fn_name: Ident,
args: String,
},
MismatchedTypeInInterfaceSurface {
interface_name: InterfaceName,
span: Span,
decl_type: String,
given: String,
expected: String,
},
UnknownTrait {
span: Span,
name: Ident,
},
FunctionNotAPartOfInterfaceSurface {
name: Ident,
interface_name: InterfaceName,
span: Span,
},
ConstantNotAPartOfInterfaceSurface {
name: Ident,
interface_name: InterfaceName,
span: Span,
},
TypeNotAPartOfInterfaceSurface {
name: Ident,
interface_name: InterfaceName,
span: Span,
},
MissingInterfaceSurfaceConstants {
missing_constants: Vec<BaseIdent>,
span: Span,
},
MissingInterfaceSurfaceTypes {
missing_types: Vec<BaseIdent>,
span: Span,
},
MissingInterfaceSurfaceMethods {
missing_functions: Vec<BaseIdent>,
span: Span,
},
IncorrectNumberOfTypeArguments {
name: Ident,
given: usize,
expected: usize,
span: Span,
},
DoesNotTakeTypeArguments {
name: Ident,
span: Span,
},
DoesNotTakeTypeArgumentsAsPrefix {
name: Ident,
span: Span,
},
TypeArgumentsNotAllowed {
span: Span,
},
NeedsTypeArguments {
name: Ident,
span: Span,
},
EnumNotFound {
name: Ident,
span: Span,
},
StructInstantiationMissingFieldForErrorRecovery {
field_name: Ident,
struct_name: Ident,
span: Span,
},
StructInstantiationMissingFields {
field_names: Vec<Ident>,
struct_name: Ident,
span: Span,
struct_decl_span: Span,
total_number_of_fields: usize,
},
StructCannotBeInstantiated {
struct_name: Ident,
span: Span,
struct_decl_span: Span,
private_fields: Vec<Ident>,
constructors: Vec<String>,
all_fields_are_private: bool,
is_in_storage_declaration: bool,
struct_can_be_changed: bool,
},
StructFieldIsPrivate {
field_name: IdentUnique,
struct_name: Ident,
field_decl_span: Span,
struct_can_be_changed: bool,
usage_context: StructFieldUsageContext,
},
StructFieldDoesNotExist {
field_name: IdentUnique,
available_fields: Vec<Ident>,
is_public_struct_access: bool,
struct_name: Ident,
struct_decl_span: Span,
struct_is_empty: bool,
usage_context: StructFieldUsageContext,
},
StructFieldDuplicated {
field_name: Ident,
duplicate: Ident,
},
MethodNotFound {
method_name: Ident,
type_name: String,
span: Span,
},
ModuleNotFound {
span: Span,
name: String,
},
FieldAccessOnNonStruct {
actually: String,
storage_variable: Option<String>,
field_name: IdentUnique,
span: Span,
},
TupleElementAccessOnNonTuple {
actually: String,
span: Span,
index: usize,
index_span: Span,
},
NotIndexable {
actually: String,
span: Span,
},
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,
},
DeclIsNotStorage {
actually: String,
span: Span,
},
DeclIsNotAConstant {
actually: String,
span: Span,
},
DeclIsNotATypeAlias {
actually: String,
span: Span,
},
SymbolNotFound {
name: Ident,
span: Span,
},
SymbolWithMultipleBindings {
name: Ident,
paths: Vec<String>,
span: Span,
},
ImportPrivateSymbol {
name: Ident,
span: Span,
},
ImportPrivateModule {
name: Ident,
span: Span,
},
NoElseBranch {
span: Span,
type: String,
},
NotAType {
span: Span,
name: String,
actually_is: &'static str,
},
MissingEnumInstantiator {
span: Span,
},
PathDoesNotReturn {
span: Span,
ty: String,
function_name: Ident,
},
ExpectedModuleDocComment {
span: Span,
},
UnknownRegister {
span: Span,
initialized_registers: String,
},
MissingImmediate {
span: Span,
},
InvalidImmediateValue {
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,
},
TraitConstraintNotSatisfied {
type_id: usize,
ty: String,
trait_name: String,
span: Span,
},
TraitConstraintMissing {
param: String,
trait_name: String,
span: Span,
},
Immediate06TooLarge {
val: u64,
span: Span,
},
Immediate12TooLarge {
val: u64,
span: Span,
},
Immediate18TooLarge {
val: u64,
span: Span,
},
Immediate24TooLarge {
val: u64,
span: Span,
},
IncorrectNumberOfAsmRegisters {
span: Span,
expected: usize,
received: usize,
},
UnnecessaryImmediate {
span: Span,
},
AmbiguousPath {
span: Span,
},
ModulePathIsNotAnExpression {
module_path: String,
span: Span,
},
UnknownType {
span: Span,
},
UnknownTypeName {
name: String,
span: Span,
},
FileCouldNotBeRead {
span: Span,
file_path: String,
stringified_error: String,
},
ImportMustBeLibrary {
span: Span,
},
MoreThanOneEnumInstantiator {
span: Span,
ty: String,
},
UnnecessaryEnumInstantiator {
span: Span,
},
UnitVariantWithParenthesesEnumInstantiator {
span: Span,
ty: String,
},
TraitNotFound {
name: String,
span: Span,
},
TraitNotImportedAtFunctionApplication {
trait_name: String,
function_name: String,
function_call_site_span: Span,
trait_constraint_span: Span,
trait_candidates: Vec<String>,
},
InvalidExpressionOnLhs {
span: Span,
},
CannotBeEvaluatedToConst {
span: Span,
},
CannotBeEvaluatedToConfigurableSizeUnknown {
span: Span,
},
TooManyArgumentsForFunction {
span: Span,
method_name: Ident,
dot_syntax_used: bool,
expected: usize,
received: usize,
},
TooFewArgumentsForFunction {
span: Span,
method_name: Ident,
dot_syntax_used: bool,
expected: usize,
received: usize,
},
MissingParenthesesForFunction {
span: Span,
method_name: Ident,
},
InvalidAbiType {
span: Span,
},
NotAnAbi {
span: Span,
actually_is: &'static str,
},
ImplAbiForNonContract {
span: Span,
ty: String,
},
ConflictingImplsForTraitAndType {
trait_name: String,
type_implementing_for: String,
existing_impl_span: Span,
second_impl_span: Span,
},
DuplicateDeclDefinedForType {
decl_kind: String,
decl_name: String,
type_implementing_for: String,
span: Span,
},
IncorrectNumberOfInterfaceSurfaceFunctionParameters {
fn_name: Ident,
interface_name: InterfaceName,
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,
},
GMFromExternalContext {
span: Span,
},
MintFromExternalContext {
span: Span,
},
BurnFromExternalContext {
span: Span,
},
ContractStorageFromExternalContext {
span: Span,
},
InvalidOpcodeFromPredicate {
opcode: String,
span: Span,
},
ArrayOutOfBounds {
index: u64,
count: u64,
span: Span,
},
InvalidRangeEndGreaterThanStart {
start: u64,
end: u64,
span: Span,
},
TupleIndexOutOfBounds {
index: usize,
count: usize,
tuple_type: String,
span: Span,
prefix_span: Span,
},
ConstantsCannotBeShadowed {
shadowing_source: ShadowingSource,
name: IdentUnique,
constant_span: Span,
constant_decl_span: Span,
is_alias: bool,
},
ConfigurablesCannotBeShadowed {
shadowing_source: ShadowingSource,
name: IdentUnique,
configurable_span: Span,
},
ConfigurablesCannotBeMatchedAgainst {
name: IdentUnique,
configurable_span: Span,
},
ConstantShadowsVariable {
name: IdentUnique,
variable_span: Span,
},
ConstantDuplicatesConstantOrConfigurable {
existing_constant_or_configurable: &'static str,
new_constant_or_configurable: &'static str,
name: IdentUnique,
existing_span: Span,
},
ShadowsOtherSymbol {
name: IdentUnique,
},
GenericShadowsGeneric {
name: IdentUnique,
},
MatchExpressionNonExhaustive {
missing_patterns: String,
span: Span,
},
MatchStructPatternMissingFields {
missing_fields: Vec<Ident>,
missing_fields_are_public: bool,
struct_name: Ident,
struct_decl_span: Span,
total_number_of_fields: usize,
span: Span,
},
MatchStructPatternMustIgnorePrivateFields {
private_fields: Vec<Ident>,
struct_name: Ident,
struct_decl_span: Span,
all_fields_are_private: bool,
span: Span,
},
MatchArmVariableNotDefinedInAllAlternatives {
match_value: Span,
match_type: String,
variable: Ident,
missing_in_alternatives: Vec<Span>,
},
MatchArmVariableMismatchedType {
match_value: Span,
match_type: String,
variable: Ident,
first_definition: Span,
expected: String,
received: String,
},
MatchedValueIsNotValid {
supported_types_message: Vec<&'static str>,
span: Span,
},
TraitDeclPureImplImpure {
fn_name: Ident,
interface_name: InterfaceName,
attrs: String,
span: Span,
},
TraitImplPurityMismatch {
fn_name: Ident,
interface_name: InterfaceName,
attrs: String,
span: Span,
},
ImpureInNonContract {
span: Span,
},
StorageAccessMismatched {
is_pure: bool,
storage_access_violations: Vec<(Span, StorageAccess)>,
suggested_attributes: String,
span: Span,
},
ParameterRefMutabilityMismatch {
span: Span,
},
IntegerTooLarge {
span: Span,
ty: String,
},
IntegerTooSmall {
span: Span,
ty: String,
},
IntegerContainsInvalidDigit {
span: Span,
ty: String,
},
AbiAsSupertrait {
span: Span,
},
SupertraitImplRequired {
supertrait_name: String,
trait_name: Ident,
span: Span,
},
ContractCallParamRepeated {
param_name: String,
span: Span,
},
UnrecognizedContractParam {
param_name: String,
span: Span,
},
CallParamForNonContractCallMethod {
span: Span,
},
StorageFieldDoesNotExist {
field_name: IdentUnique,
available_fields: Vec<(Vec<Ident>, Ident)>,
storage_decl_span: Span,
},
NoDeclaredStorage {
span: Span,
},
MultipleStorageDeclarations {
span: Span,
},
InvalidStorageOnlyTypeDecl {
ty: String,
span: Span,
},
UnexpectedDeclaration {
decl_type: &'static str,
span: Span,
},
ContractAddressMustBeKnown {
span: Span,
},
ConvertParseTree {
error: ConvertParseTreeError,
},
Lex {
error: LexError,
},
Parse {
error: ParseError,
},
NonConstantDeclValue {
span: Span,
},
StorageDeclarationInNonContract {
program_kind: String,
span: Span,
},
IntrinsicUnsupportedArgType {
name: String,
span: Span,
hint: String,
},
IntrinsicIncorrectNumArgs {
name: String,
expected: u64,
span: Span,
},
IntrinsicIncorrectNumTArgs {
name: String,
expected: u64,
span: Span,
},
ExpectedStringLiteral {
span: Span,
},
BreakOutsideLoop {
span: Span,
},
ContinueOutsideLoop {
span: Span,
},
ContractIdConstantNotAConstDecl {
span: Span,
},
ContractIdValueNotALiteral {
span: Span,
},
TypeNotAllowed {
reason: TypeNotAllowedReason,
span: Span,
},
RefMutableNotAllowedInMain {
param_name: Ident,
span: Span,
},
InitializedRegisterReassignment {
name: String,
span: Span,
},
DisallowedControlFlowInstruction {
name: String,
span: Span,
},
CallingPrivateLibraryMethod {
name: String,
span: Span,
},
DisallowedIntrinsicInPredicate {
intrinsic: String,
span: Span,
},
CoinsPassedToNonPayableMethod {
fn_name: Ident,
span: Span,
},
TraitImplPayabilityMismatch {
fn_name: Ident,
interface_name: InterfaceName,
missing_impl_attribute: bool,
span: Span,
},
ConfigurableInLibrary {
span: Span,
},
MultipleApplicableItemsInScope {
span: Span,
type_name: String,
item_name: String,
item_kind: String,
as_traits: Vec<String>,
},
NonStrGenericType {
span: Span,
},
ContractCallsItsOwnMethod {
span: Span,
},
AbiShadowsSuperAbiMethod {
span: Span,
superabi: Ident,
},
ConflictingSuperAbiMethods {
span: Span,
method_name: String,
superabi1: String,
superabi2: String,
},
AssociatedTypeNotSupportedInAbi {
span: Span,
},
AbiSupertraitMethodCallAsContractCall {
fn_name: Ident,
span: Span,
},
TypeIsNotValidAsImplementingFor {
invalid_type: InvalidImplementingForType,
trait_name: Option<String>,
span: Span,
},
UninitRegisterInAsmBlockBeingRead {
span: Span,
},
ExpressionCannotBeDereferenced {
expression_type: String,
span: Span,
},
FallbackFnsAreContractOnly {
span: Span,
},
FallbackFnsCannotHaveParameters {
span: Span,
},
CouldNotGenerateEntry {
span: Span,
},
CouldNotGenerateEntryMissingCore {
span: Span,
},
CouldNotGenerateEntryMissingImpl {
ty: String,
span: Span,
},
EncodingUnsupportedType {
span: Span,
},
ConfigurableMissingAbiDecodeInPlace {
span: Span,
},
ABIHashCollision {
span: Span,
hash: String,
first_type: String,
second_type: String,
},
TypeMustBeKnownAtThisPoint {
span: Span,
internal: String,
},
}Variants§
ModuleDepGraphEvaluationError
ModuleDepGraphCyclicReference
UnknownVariable
NotAVariable
Unimplemented
Fields
feature: StringThe description of the unimplemented feature, formulated in a way that fits into common ending “is currently not implemented.” E.g., “Using something”.
TypeError(TypeError)
ParseError
Internal(&'static str, Span)
InternalOwned(String, Span)
NoPredicateMainFunction(Span)
PredicateMainDoesNotReturnBool(Span)
NoScriptMainFunction(Span)
MultipleDefinitionsOfFallbackFunction
MultipleDefinitionsOfFunction
MultipleDefinitionsOfName
MultipleDefinitionsOfConstant
MultipleDefinitionsOfType
MultipleDefinitionsOfMatchArmVariable
Fields
AssignmentToNonMutableVariable
Fields
AssignmentToConstantOrConfigurable
Fields
DeclAssignmentTargetCannotBeAssignedTo
Fields
AssignmentViaNonMutableReference
Fields
decl_reference_name: Option<Ident>Name of the reference, if the left-hand side of the assignment is a reference variable, pointing to the name in the reference variable declaration.
None if the assignment LHS is an arbitrary expression and not a variable.
decl_reference_rhs: Option<Span>Span of the right-hand side of the reference variable definition, if the left-hand side of the assignment is a reference variable.
MethodRequiresMutableSelf
MutableParameterNotSupported
ImmutableArgumentToMutableParameter
RefMutableNotAllowedInContractAbi
RefMutCannotReferenceConstant
Fields
RefMutCannotReferenceImmutableVariable
AssociatedFunctionCalledAsMethod
TypeParameterNotInTypeScope
MismatchedTypeInInterfaceSurface
UnknownTrait
FunctionNotAPartOfInterfaceSurface
ConstantNotAPartOfInterfaceSurface
TypeNotAPartOfInterfaceSurface
MissingInterfaceSurfaceConstants
MissingInterfaceSurfaceTypes
MissingInterfaceSurfaceMethods
IncorrectNumberOfTypeArguments
DoesNotTakeTypeArguments
DoesNotTakeTypeArgumentsAsPrefix
TypeArgumentsNotAllowed
NeedsTypeArguments
EnumNotFound
StructInstantiationMissingFieldForErrorRecovery
This error is used only for error recovery and is not emitted as a compiler error to the final compilation output. The compiler emits the cumulative error CompileError::StructInstantiationMissingFields given below, and that one also only if the struct can actually be instantiated.
StructInstantiationMissingFields
Fields
StructCannotBeInstantiated
Fields
StructFieldIsPrivate
StructFieldDoesNotExist
StructFieldDuplicated
MethodNotFound
ModuleNotFound
FieldAccessOnNonStruct
Fields
storage_variable: Option<String>Name of the storage variable, if the field access happens within the access to a storage variable.
field_name: IdentUniqueName of the field that is tried to be accessed.
TupleElementAccessOnNonTuple
NotIndexable
NotAnEnum
NotAStruct
DeclIsNotAnEnum
DeclIsNotAStruct
DeclIsNotAFunction
DeclIsNotAVariable
DeclIsNotAnAbi
DeclIsNotATrait
DeclIsNotAnImplTrait
DeclIsNotATraitFn
DeclIsNotStorage
DeclIsNotAConstant
DeclIsNotATypeAlias
SymbolNotFound
SymbolWithMultipleBindings
ImportPrivateSymbol
ImportPrivateModule
NoElseBranch
NotAType
MissingEnumInstantiator
PathDoesNotReturn
ExpectedModuleDocComment
UnknownRegister
MissingImmediate
InvalidImmediateValue
UnknownEnumVariant
UnrecognizedOp
UnableToInferGeneric
UnconstrainedGenericParameter
TraitConstraintNotSatisfied
TraitConstraintMissing
Immediate06TooLarge
Immediate12TooLarge
Immediate18TooLarge
Immediate24TooLarge
IncorrectNumberOfAsmRegisters
UnnecessaryImmediate
AmbiguousPath
ModulePathIsNotAnExpression
UnknownType
UnknownTypeName
FileCouldNotBeRead
ImportMustBeLibrary
MoreThanOneEnumInstantiator
UnnecessaryEnumInstantiator
UnitVariantWithParenthesesEnumInstantiator
TraitNotFound
TraitNotImportedAtFunctionApplication
Fields
InvalidExpressionOnLhs
CannotBeEvaluatedToConst
CannotBeEvaluatedToConfigurableSizeUnknown
TooManyArgumentsForFunction
TooFewArgumentsForFunction
MissingParenthesesForFunction
InvalidAbiType
NotAnAbi
ImplAbiForNonContract
ConflictingImplsForTraitAndType
Fields
DuplicateDeclDefinedForType
IncorrectNumberOfInterfaceSurfaceFunctionParameters
Fields
interface_name: InterfaceNameArgumentParameterTypeMismatch
RecursiveCall
RecursiveCallChain
RecursiveType
RecursiveTypeChain
GMFromExternalContext
MintFromExternalContext
BurnFromExternalContext
ContractStorageFromExternalContext
InvalidOpcodeFromPredicate
ArrayOutOfBounds
InvalidRangeEndGreaterThanStart
TupleIndexOutOfBounds
ConstantsCannotBeShadowed
Fields
shadowing_source: ShadowingSourceDefines what shadows the constant.
Although being ready in the diagnostic, the PatternMatchingStructFieldVar option
is currently not used. Getting the information about imports and aliases while
type checking match branches is too much effort at the moment, compared to gained
additional clarity of the error message. We might add support for this option in
the future.
name: IdentUniqueConfigurablesCannotBeShadowed
Fields
shadowing_source: ShadowingSourceDefines what shadows the configurable.
Using configurable in pattern matching, expecting to behave same as a constant,
will result in CompileError::ConfigurablesCannotBeMatchedAgainst.
Otherwise, we would end up with a very confusing error message that
a configurable cannot be shadowed by a variable.
In the, unlikely but equally confusing, case of a struct field pattern variable
named same as the configurable we also want to provide a better explanation
and shadowing_source helps us distinguish that case as well.
name: IdentUniqueConfigurablesCannotBeMatchedAgainst
ConstantShadowsVariable
ConstantDuplicatesConstantOrConfigurable
Fields
existing_constant_or_configurable: &'static strText “Constant” or “Configurable”. Denotes already declared constant or configurable.
new_constant_or_configurable: &'static strText “Constant” or “Configurable”. Denotes constant or configurable attempted to be declared.
name: IdentUniqueShadowsOtherSymbol
Fields
name: IdentUniqueGenericShadowsGeneric
Fields
name: IdentUniqueMatchExpressionNonExhaustive
MatchStructPatternMissingFields
Fields
MatchStructPatternMustIgnorePrivateFields
Fields
MatchArmVariableNotDefinedInAllAlternatives
MatchArmVariableMismatchedType
Fields
MatchedValueIsNotValid
Fields
TraitDeclPureImplImpure
TraitImplPurityMismatch
ImpureInNonContract
StorageAccessMismatched
Fields
storage_access_violations: Vec<(Span, StorageAccess)>ParameterRefMutabilityMismatch
IntegerTooLarge
IntegerTooSmall
IntegerContainsInvalidDigit
AbiAsSupertrait
SupertraitImplRequired
ContractCallParamRepeated
UnrecognizedContractParam
CallParamForNonContractCallMethod
StorageFieldDoesNotExist
NoDeclaredStorage
MultipleStorageDeclarations
InvalidStorageOnlyTypeDecl
UnexpectedDeclaration
ContractAddressMustBeKnown
ConvertParseTree
Fields
error: ConvertParseTreeErrorLex
Parse
Fields
error: ParseErrorNonConstantDeclValue
StorageDeclarationInNonContract
IntrinsicUnsupportedArgType
IntrinsicIncorrectNumArgs
IntrinsicIncorrectNumTArgs
ExpectedStringLiteral
BreakOutsideLoop
ContinueOutsideLoop
ContractIdConstantNotAConstDecl
This will be removed once loading contract IDs in a dependency namespace is refactored and no longer manual: https://github.com/FuelLabs/sway/issues/3077
ContractIdValueNotALiteral
This will be removed once loading contract IDs in a dependency namespace is refactored and no longer manual: https://github.com/FuelLabs/sway/issues/3077
TypeNotAllowed
RefMutableNotAllowedInMain
InitializedRegisterReassignment
DisallowedControlFlowInstruction
CallingPrivateLibraryMethod
DisallowedIntrinsicInPredicate
CoinsPassedToNonPayableMethod
TraitImplPayabilityMismatch
ConfigurableInLibrary
MultipleApplicableItemsInScope
NonStrGenericType
ContractCallsItsOwnMethod
AbiShadowsSuperAbiMethod
ConflictingSuperAbiMethods
AssociatedTypeNotSupportedInAbi
AbiSupertraitMethodCallAsContractCall
TypeIsNotValidAsImplementingFor
Fields
invalid_type: InvalidImplementingForTypeUninitRegisterInAsmBlockBeingRead
ExpressionCannotBeDereferenced
FallbackFnsAreContractOnly
FallbackFnsCannotHaveParameters
CouldNotGenerateEntry
CouldNotGenerateEntryMissingCore
CouldNotGenerateEntryMissingImpl
EncodingUnsupportedType
ConfigurableMissingAbiDecodeInPlace
ABIHashCollision
TypeMustBeKnownAtThisPoint
Trait Implementations§
source§impl Clone for CompileError
impl Clone for CompileError
source§fn clone(&self) -> CompileError
fn clone(&self) -> CompileError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for CompileError
impl Debug for CompileError
source§impl Display for CompileError
impl Display for CompileError
source§impl Error for CompileError
impl Error for CompileError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<ConvertParseTreeError> for CompileError
impl From<ConvertParseTreeError> for CompileError
source§fn from(source: ConvertParseTreeError) -> Self
fn from(source: ConvertParseTreeError) -> Self
source§impl From<TypeError> for CompileError
impl From<TypeError> for CompileError
source§fn from(other: TypeError) -> CompileError
fn from(other: TypeError) -> CompileError
source§impl Hash for CompileError
impl Hash for CompileError
source§impl PartialEq for CompileError
impl PartialEq for CompileError
source§impl ToDiagnostic for CompileError
impl ToDiagnostic for CompileError
fn to_diagnostic(&self, source_engine: &SourceEngine) -> Diagnostic
impl Eq for CompileError
impl StructuralPartialEq for CompileError
Auto Trait Implementations§
impl Freeze for CompileError
impl RefUnwindSafe for CompileError
impl Send for CompileError
impl Sync for CompileError
impl Unpin for CompileError
impl UnwindSafe for CompileError
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.source§impl<T> StorageAsMut for T
impl<T> StorageAsMut for T
fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
source§impl<T> StorageAsRef for T
impl<T> StorageAsRef for T
fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.