sway_error::error

Enum CompileError

Source
pub enum CompileError {
Show 202 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: String, type_name: String, matching_method_strings: Vec<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, item_name: String, item_kind: String, as_traits: Vec<(String, 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, }, MultipleImplsSatisfyingTraitForType { span: Span, type_annotation: String, trait_names: Vec<String>, trait_types_and_names: Vec<(String, String)>, },
}

Variants§

§

ModuleDepGraphEvaluationError

§

ModuleDepGraphCyclicReference

Fields

§modules: Vec<BaseIdent>
§

UnknownVariable

Fields

§var_name: Ident
§span: Span
§

NotAVariable

Fields

§name: Ident
§what_it_is: &'static str
§span: Span
§

Unimplemented

Fields

§feature: String

The description of the unimplemented feature, formulated in a way that fits into common ending “is currently not implemented.” E.g., “Using something”.

§help: Vec<String>

Help lines. Empty if there is no additional help. To get an empty line between the help lines, insert a String containing only a space: " ".to_string().

§span: Span
§

TypeError(TypeError)

§

ParseError

Fields

§span: Span
§

Internal(&'static str, Span)

§

InternalOwned(String, Span)

§

NoPredicateMainFunction(Span)

§

PredicateMainDoesNotReturnBool(Span)

§

NoScriptMainFunction(Span)

§

MultipleDefinitionsOfFallbackFunction

Fields

§name: Ident
§span: Span
§

MultipleDefinitionsOfFunction

Fields

§name: Ident
§span: Span
§

MultipleDefinitionsOfName

Fields

§name: Ident
§span: Span
§

MultipleDefinitionsOfConstant

Fields

§name: Ident
§span: Span
§

MultipleDefinitionsOfType

Fields

§name: Ident
§span: Span
§

MultipleDefinitionsOfMatchArmVariable

Fields

§match_value: Span
§match_type: String
§first_definition: Span
§first_definition_is_struct_field: bool
§duplicate: Span
§duplicate_is_struct_field: bool
§

AssignmentToNonMutableVariable

Fields

§decl_name: Ident

Variable name pointing to the name in the variable declaration.

§lhs_span: Span

The complete left-hand side of the assignment.

§

AssignmentToConstantOrConfigurable

Fields

§decl_name: Ident

Constant or configurable name pointing to the name in the constant declaration.

§is_configurable: bool
§lhs_span: Span

The complete left-hand side of the assignment.

§

DeclAssignmentTargetCannotBeAssignedTo

Fields

§decl_name: Option<Ident>

Name of the declared variant, pointing to the name in the declaration.

§decl_friendly_type_name: &'static str

Friendly name of the type of the declaration. E.g., “function”, or “struct”.

§lhs_span: Span

The complete left-hand side of the assignment.

§

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.

§decl_reference_type: String

The type of the reference, if the left-hand side of the assignment is a reference variable, expected to start with &.

§span: Span
§

MethodRequiresMutableSelf

Fields

§method_name: Ident
§variable_name: Ident
§span: Span
§

MutableParameterNotSupported

Fields

§param_name: Ident
§span: Span
§

ImmutableArgumentToMutableParameter

Fields

§span: Span
§

RefMutableNotAllowedInContractAbi

Fields

§param_name: Ident
§span: Span
§

RefMutCannotReferenceConstant

Fields

§constant: String

Constant, as accessed in code. E.g.:

  • MY_CONST
  • LIB_CONST_ALIAS
  • ::lib::module::SOME_CONST
§span: Span
§

RefMutCannotReferenceImmutableVariable

Fields

§decl_name: Ident

Variable name pointing to the name in the variable declaration.

§span: Span
§

AssociatedFunctionCalledAsMethod

Fields

§fn_name: Ident
§span: Span
§

TypeParameterNotInTypeScope

Fields

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

MismatchedTypeInInterfaceSurface

Fields

§interface_name: InterfaceName
§span: Span
§decl_type: String
§given: String
§expected: String
§

UnknownTrait

Fields

§span: Span
§name: Ident
§

FunctionNotAPartOfInterfaceSurface

Fields

§name: Ident
§interface_name: InterfaceName
§span: Span
§

ConstantNotAPartOfInterfaceSurface

Fields

§name: Ident
§interface_name: InterfaceName
§span: Span
§

TypeNotAPartOfInterfaceSurface

Fields

§name: Ident
§interface_name: InterfaceName
§span: Span
§

MissingInterfaceSurfaceConstants

Fields

§missing_constants: Vec<BaseIdent>
§span: Span
§

MissingInterfaceSurfaceTypes

Fields

§missing_types: Vec<BaseIdent>
§span: Span
§

MissingInterfaceSurfaceMethods

Fields

§missing_functions: Vec<BaseIdent>
§span: Span
§

IncorrectNumberOfTypeArguments

Fields

§name: Ident
§given: usize
§expected: usize
§span: Span
§

DoesNotTakeTypeArguments

Fields

§name: Ident
§span: Span
§

DoesNotTakeTypeArgumentsAsPrefix

Fields

§name: Ident
§span: Span
§

TypeArgumentsNotAllowed

Fields

§span: Span
§

NeedsTypeArguments

Fields

§name: Ident
§span: Span
§

EnumNotFound

Fields

§name: Ident
§span: Span
§

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.

Fields

§field_name: Ident
§struct_name: Ident

Original, non-aliased struct name.

§span: Span
§

StructInstantiationMissingFields

Fields

§field_names: Vec<Ident>
§struct_name: Ident

Original, non-aliased struct name.

§span: Span
§struct_decl_span: Span
§total_number_of_fields: usize
§

StructCannotBeInstantiated

Fields

§struct_name: Ident

Original, non-aliased struct name.

§span: Span
§struct_decl_span: Span
§private_fields: Vec<Ident>
§constructors: Vec<String>

All available public constructors if is_in_storage_declaration is false, or only the public constructors that potentially evaluate to a constant if is_in_storage_declaration is true.

§all_fields_are_private: bool

True if the struct has only private fields.

§is_in_storage_declaration: bool
§struct_can_be_changed: bool
§

StructFieldIsPrivate

Fields

§field_name: IdentUnique
§struct_name: Ident

Original, non-aliased struct name.

§field_decl_span: Span
§struct_can_be_changed: bool
§

StructFieldDoesNotExist

Fields

§field_name: IdentUnique
§available_fields: Vec<Ident>

Only public fields if is_public_struct_access is true.

§is_public_struct_access: bool
§struct_name: Ident

Original, non-aliased struct name.

§struct_decl_span: Span
§struct_is_empty: bool
§

StructFieldDuplicated

Fields

§field_name: Ident
§duplicate: Ident
§

MethodNotFound

Fields

§method: String
§type_name: String
§matching_method_strings: Vec<String>
§span: Span
§

ModuleNotFound

Fields

§span: Span
§name: String
§

FieldAccessOnNonStruct

Fields

§actually: String
§storage_variable: Option<String>

Name of the storage variable, if the field access happens within the access to a storage variable.

§field_name: IdentUnique

Name of the field that is tried to be accessed.

§span: Span
§

TupleElementAccessOnNonTuple

Fields

§actually: String
§span: Span
§index: usize
§index_span: Span
§

NotIndexable

Fields

§actually: String
§span: Span
§

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
§

DeclIsNotStorage

Fields

§actually: String
§span: Span
§

DeclIsNotAConstant

Fields

§actually: String
§span: Span
§

DeclIsNotATypeAlias

Fields

§actually: String
§span: Span
§

SymbolNotFound

Fields

§name: Ident
§span: Span
§

SymbolWithMultipleBindings

Fields

§name: Ident
§paths: Vec<String>
§span: Span
§

ImportPrivateSymbol

Fields

§name: Ident
§span: Span
§

ImportPrivateModule

Fields

§name: Ident
§span: Span
§

NoElseBranch

Fields

§span: Span
§type: String
§

NotAType

Fields

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

MissingEnumInstantiator

Fields

§span: Span
§

PathDoesNotReturn

Fields

§span: Span
§function_name: Ident
§

ExpectedModuleDocComment

Fields

§span: Span
§

UnknownRegister

Fields

§span: Span
§initialized_registers: String
§

MissingImmediate

Fields

§span: Span
§

InvalidImmediateValue

Fields

§span: Span
§

UnknownEnumVariant

Fields

§enum_name: Ident
§variant_name: Ident
§span: Span
§

UnrecognizedOp

Fields

§op_name: Ident
§span: Span
§

UnableToInferGeneric

Fields

§span: Span
§

UnconstrainedGenericParameter

Fields

§span: Span
§

TraitConstraintNotSatisfied

Fields

§type_id: usize
§trait_name: String
§span: Span
§

TraitConstraintMissing

Fields

§param: String
§trait_name: 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
§

IncorrectNumberOfAsmRegisters

Fields

§span: Span
§expected: usize
§received: usize
§

UnnecessaryImmediate

Fields

§span: Span
§

AmbiguousPath

Fields

§span: Span
§

ModulePathIsNotAnExpression

Fields

§module_path: String
§span: Span
§

UnknownType

Fields

§span: Span
§

UnknownTypeName

Fields

§name: String
§span: Span
§

FileCouldNotBeRead

Fields

§span: Span
§file_path: String
§stringified_error: String
§

ImportMustBeLibrary

Fields

§span: Span
§

MoreThanOneEnumInstantiator

Fields

§span: Span
§

UnnecessaryEnumInstantiator

Fields

§span: Span
§

UnitVariantWithParenthesesEnumInstantiator

Fields

§span: Span
§

TraitNotFound

Fields

§name: String
§span: Span
§

TraitNotImportedAtFunctionApplication

Fields

§trait_name: String
§function_name: String
§function_call_site_span: Span
§trait_constraint_span: Span
§trait_candidates: Vec<String>
§

InvalidExpressionOnLhs

Fields

§span: Span
§

CannotBeEvaluatedToConst

Fields

§span: Span
§

CannotBeEvaluatedToConfigurableSizeUnknown

Fields

§span: Span
§

TooManyArgumentsForFunction

Fields

§span: Span
§method_name: Ident
§dot_syntax_used: bool
§expected: usize
§received: usize
§

TooFewArgumentsForFunction

Fields

§span: Span
§method_name: Ident
§dot_syntax_used: bool
§expected: usize
§received: usize
§

MissingParenthesesForFunction

Fields

§span: Span
§method_name: Ident
§

InvalidAbiType

Fields

§span: Span
§

NotAnAbi

Fields

§span: Span
§actually_is: &'static str
§

ImplAbiForNonContract

Fields

§span: Span
§

ConflictingImplsForTraitAndType

Fields

§trait_name: String
§type_implementing_for: String
§existing_impl_span: Span
§second_impl_span: Span
§

DuplicateDeclDefinedForType

Fields

§decl_kind: String
§decl_name: String
§type_implementing_for: String
§span: Span
§

IncorrectNumberOfInterfaceSurfaceFunctionParameters

Fields

§fn_name: Ident
§interface_name: InterfaceName
§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
§

GMFromExternalContext

Fields

§span: Span
§

MintFromExternalContext

Fields

§span: Span
§

BurnFromExternalContext

Fields

§span: Span
§

ContractStorageFromExternalContext

Fields

§span: Span
§

InvalidOpcodeFromPredicate

Fields

§opcode: String
§span: Span
§

ArrayOutOfBounds

Fields

§index: u64
§count: u64
§span: Span
§

InvalidRangeEndGreaterThanStart

Fields

§start: u64
§end: u64
§span: Span
§

TupleIndexOutOfBounds

Fields

§index: usize
§count: usize
§tuple_type: String
§span: Span
§prefix_span: Span
§

ConstantsCannotBeShadowed

Fields

§shadowing_source: ShadowingSource

Defines 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.

§constant_span: Span
§constant_decl_span: Span
§is_alias: bool
§

ConfigurablesCannotBeShadowed

Fields

§shadowing_source: ShadowingSource

Defines 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.

§configurable_span: Span
§

ConfigurablesCannotBeMatchedAgainst

Fields

§configurable_span: Span
§

ConstantShadowsVariable

Fields

§variable_span: Span
§

ConstantDuplicatesConstantOrConfigurable

Fields

§existing_constant_or_configurable: &'static str

Text “Constant” or “Configurable”. Denotes already declared constant or configurable.

§new_constant_or_configurable: &'static str

Text “Constant” or “Configurable”. Denotes constant or configurable attempted to be declared.

§existing_span: Span
§

ShadowsOtherSymbol

Fields

§

GenericShadowsGeneric

Fields

§

MatchExpressionNonExhaustive

Fields

§missing_patterns: String
§span: Span
§

MatchStructPatternMissingFields

Fields

§missing_fields: Vec<Ident>
§missing_fields_are_public: bool
§struct_name: Ident

Original, non-aliased struct name.

§struct_decl_span: Span
§total_number_of_fields: usize
§span: Span
§

MatchStructPatternMustIgnorePrivateFields

Fields

§private_fields: Vec<Ident>
§struct_name: Ident

Original, non-aliased struct name.

§struct_decl_span: Span
§all_fields_are_private: bool
§span: Span
§

MatchArmVariableNotDefinedInAllAlternatives

Fields

§match_value: Span
§match_type: String
§variable: Ident
§missing_in_alternatives: Vec<Span>
§

MatchArmVariableMismatchedType

Fields

§match_value: Span
§match_type: String
§variable: Ident
§first_definition: Span
§expected: String
§received: String
§

MatchedValueIsNotValid

Fields

§supported_types_message: Vec<&'static str>

Common message describing which Sway types are currently supported in match expressions.

§span: Span
§

TraitDeclPureImplImpure

Fields

§fn_name: Ident
§interface_name: InterfaceName
§attrs: String
§span: Span
§

TraitImplPurityMismatch

Fields

§fn_name: Ident
§interface_name: InterfaceName
§attrs: String
§span: Span
§

ImpureInNonContract

Fields

§span: Span
§

StorageAccessMismatched

Fields

§is_pure: bool

True if the function with mismatched access is pure.

§storage_access_violations: Vec<(Span, StorageAccess)>
§suggested_attributes: String
§span: Span

Span pointing to the name of the function in the function declaration, whose storage attributes mismatch the storage access patterns.

§

ParameterRefMutabilityMismatch

Fields

§span: Span
§

IntegerTooLarge

Fields

§span: Span
§

IntegerTooSmall

Fields

§span: Span
§

IntegerContainsInvalidDigit

Fields

§span: Span
§

AbiAsSupertrait

Fields

§span: Span
§

SupertraitImplRequired

Fields

§supertrait_name: String
§trait_name: Ident
§span: Span
§

ContractCallParamRepeated

Fields

§param_name: String
§span: Span
§

UnrecognizedContractParam

Fields

§param_name: String
§span: Span
§

CallParamForNonContractCallMethod

Fields

§span: Span
§

StorageFieldDoesNotExist

Fields

§field_name: IdentUnique
§available_fields: Vec<(Vec<Ident>, Ident)>
§storage_decl_span: Span
§

NoDeclaredStorage

Fields

§span: Span
§

MultipleStorageDeclarations

Fields

§span: Span
§

InvalidStorageOnlyTypeDecl

Fields

§span: Span
§

UnexpectedDeclaration

Fields

§decl_type: &'static str
§span: Span
§

ContractAddressMustBeKnown

Fields

§span: Span
§

ConvertParseTree

§

Lex

Fields

§error: LexError
§

Parse

Fields

§

NonConstantDeclValue

Fields

§span: Span
§

StorageDeclarationInNonContract

Fields

§program_kind: String
§span: Span
§

IntrinsicUnsupportedArgType

Fields

§name: String
§span: Span
§hint: String
§

IntrinsicIncorrectNumArgs

Fields

§name: String
§expected: u64
§span: Span
§

IntrinsicIncorrectNumTArgs

Fields

§name: String
§expected: u64
§span: Span
§

ExpectedStringLiteral

Fields

§span: Span
§

BreakOutsideLoop

Fields

§span: Span
§

ContinueOutsideLoop

Fields

§span: Span
§

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

Fields

§span: Span
§

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

Fields

§span: Span
§

TypeNotAllowed

Fields

§span: Span
§

RefMutableNotAllowedInMain

Fields

§param_name: Ident
§span: Span
§

InitializedRegisterReassignment

Fields

§name: String
§span: Span
§

DisallowedControlFlowInstruction

Fields

§name: String
§span: Span
§

CallingPrivateLibraryMethod

Fields

§name: String
§span: Span
§

DisallowedIntrinsicInPredicate

Fields

§intrinsic: String
§span: Span
§

CoinsPassedToNonPayableMethod

Fields

§fn_name: Ident
§span: Span
§

TraitImplPayabilityMismatch

Fields

§fn_name: Ident
§interface_name: InterfaceName
§missing_impl_attribute: bool
§span: Span
§

ConfigurableInLibrary

Fields

§span: Span
§

MultipleApplicableItemsInScope

Fields

§span: Span
§item_name: String
§item_kind: String
§as_traits: Vec<(String, String)>
§

NonStrGenericType

Fields

§span: Span
§

ContractCallsItsOwnMethod

Fields

§span: Span
§

AbiShadowsSuperAbiMethod

Fields

§span: Span
§superabi: Ident
§

ConflictingSuperAbiMethods

Fields

§span: Span
§method_name: String
§superabi1: String
§superabi2: String
§

AssociatedTypeNotSupportedInAbi

Fields

§span: Span
§

AbiSupertraitMethodCallAsContractCall

Fields

§fn_name: Ident
§span: Span
§

TypeIsNotValidAsImplementingFor

Fields

§trait_name: Option<String>

Name of the trait if the impl implements a trait, None otherwise.

§span: Span
§

UninitRegisterInAsmBlockBeingRead

Fields

§span: Span
§

ExpressionCannotBeDereferenced

Fields

§expression_type: String
§span: Span
§

FallbackFnsAreContractOnly

Fields

§span: Span
§

FallbackFnsCannotHaveParameters

Fields

§span: Span
§

CouldNotGenerateEntry

Fields

§span: Span
§

CouldNotGenerateEntryMissingCore

Fields

§span: Span
§

CouldNotGenerateEntryMissingImpl

Fields

§span: Span
§

EncodingUnsupportedType

Fields

§span: Span
§

ConfigurableMissingAbiDecodeInPlace

Fields

§span: Span
§

ABIHashCollision

Fields

§span: Span
§hash: String
§first_type: String
§second_type: String
§

TypeMustBeKnownAtThisPoint

Fields

§span: Span
§internal: String
§

MultipleImplsSatisfyingTraitForType

Fields

§span: Span
§type_annotation: String
§trait_names: Vec<String>
§trait_types_and_names: Vec<(String, String)>

Trait Implementations§

Source§

impl Clone for CompileError

Source§

fn clone(&self) -> CompileError

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CompileError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CompileError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for CompileError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ConvertParseTreeError> for CompileError

Source§

fn from(source: ConvertParseTreeError) -> Self

Converts to this type from the input type.
Source§

impl From<TypeError> for CompileError

Source§

fn from(other: TypeError) -> CompileError

Converts to this type from the input type.
Source§

impl Hash for CompileError

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl PartialEq for CompileError

Source§

fn eq(&self, other: &CompileError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Spanned for CompileError

Source§

fn span(&self) -> Span

Source§

impl ToDiagnostic for CompileError

Source§

fn to_diagnostic(&self, source_engine: &SourceEngine) -> Diagnostic

Source§

impl Eq for CompileError

Source§

impl StructuralPartialEq for CompileError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

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

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StorageAsMut for T

Source§

fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>
where Type: Mappable,

Source§

fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>
where Type: Mappable,

Source§

impl<T> StorageAsRef for T

Source§

fn storage<Type>(&self) -> StorageRef<'_, Self, Type>
where Type: Mappable,

Source§

fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>
where Type: Mappable,

Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .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
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .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
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V