Skip to main content

Move compiler diagnostics

Generated from the Sui source (MystenLabs/sui at commit e25770145) on 2026-11-16 by error_pages.py in MystenLabs/docs-data-dashboard. Do not edit this page by hand: the weekly run regenerates it from the source. To change a message, edit the codes! table in external-crates/move/crates/move-compiler/src/diagnostics/codes.rs, or the lints! table in external-crates/move/crates/move-compiler/src/sui_mode/linters/mod.rs or linters/mod.rs.

Every diagnostic the Move compiler can report, 162 codes in 16 categories, and the 27 lints it checks. The compiler prints a code as EC01003: a severity letter (E for an error, W for a warning), C for the compiler as the origin, then the category number and the code number. Older versions printed it without the origin letter, as E01003, and that form still appears in questions and issues, so both are listed.

Diagnostic codes​

Uncategorized​

CodeLegacy codeNameSeverityMessage
WC00001W00001DeprecatedWillBeRemovedWarningDEPRECATED. will be removed
EC00002E00002DeprecatedSpecItemNonblockingErrorDEPRECATED. unexpected spec item
EC00003E00003UnableToMigrateNonblockingErrormigration failed

Syntax​

CodeLegacy codeNameSeverityMessage
EC01001E01001InvalidCharacterNonblockingErrorinvalid character
EC01002E01002UnexpectedTokenNonblockingErrorunexpected token
EC01003E01003InvalidModifierNonblockingErrorinvalid modifier
WC01004W01004InvalidDocCommentWarninginvalid documentation comment
EC01005E01005InvalidAddressNonblockingErrorinvalid address
EC01006E01006InvalidNumberNonblockingErrorinvalid number literal
EC01007E01007InvalidByteStringNonblockingErrorinvalid byte string
EC01008E01008InvalidHexStringNonblockingErrorinvalid hex string
EC01009E01009InvalidLValueNonblockingErrorinvalid assignment
EC01010E01010SpecContextRestrictedBlockingErrorsyntax item restricted to spec contexts
EC01011E01011InvalidSpecBlockMemberNonblockingErrorinvalid spec block member
EC01012E01012InvalidRestrictedIdentifierNonblockingErrorinvalid identifier escape
EC01013E01013InvalidMoveOrCopyNonblockingErrorinvalid 'move' or 'copy'
EC01014E01014InvalidLabelNonblockingErrorinvalid expression label
EC01015E01015AmbiguousCastNonblockingErrorambiguous 'as'
EC01016E01016InvalidNameBlockingErrorinvalid name
EC01017E01017InvalidMacroBlockingErrorinvalid macro invocation
EC01018E01018InvalidMatchBlockingErrorinvalid 'match'
EC01019E01019InvalidStringNonblockingErrorinvalid string literal

Declarations​

CodeLegacy codeNameSeverityMessage
EC02001E02001DuplicateItemNonblockingErrorduplicate declaration, item, or annotation
EC02002E02002UnnecessaryItemNonblockingErrorunnecessary or extraneous item
EC02003E02003InvalidAddressNonblockingErrorinvalid 'address' declaration
EC02004E02004InvalidModuleNonblockingErrorinvalid 'module' declaration
EC02005E02005InvalidScriptNonblockingErrorinvalid 'script' declaration
EC02006E02006InvalidConstantNonblockingErrorinvalid 'const' declaration
EC02007E02007InvalidFunctionNonblockingErrorinvalid 'fun' declaration
EC02008E02008InvalidStructNonblockingErrorinvalid 'struct' declaration
EC02009E02009InvalidSpecNonblockingErrorinvalid 'spec' declaration
EC02010E02010InvalidNameBlockingErrorinvalid declaration name
EC02011E02011InvalidFriendDeclarationNonblockingErrorinvalid 'friend' declaration
EC02012E02012DeprecatedInvalidAcquiresItemNonblockingErrorDEPRECATED. invalid 'acquires' item
EC02013E02013InvalidPhantomUseNonblockingErrorinvalid phantom type parameter usage
WC02014W02014InvalidNonPhantomUseWarninginvalid non-phantom type parameter usage
EC02015E02015InvalidAttributeNonblockingErrorinvalid attribute
EC02016E02016InvalidVisibilityModifierNonblockingErrorinvalid visibility modifier
EC02017E02017InvalidUseFunNonblockingErrorinvalid 'use fun' declaration
WC02018W02018UnknownAttributeWarningunknown attribute
EC02019E02019InvalidSyntaxMethodNonblockingErrorinvalid 'syntax' method type
EC02020E02020MissingSyntaxMethodBlockingErrorno valid 'syntax' declaration found
WC02021W02021DuplicateAliasWarningduplicate alias
EC02022E02022InvalidEnumNonblockingErrorinvalid 'enum' declaration
WC02023W02023AmbiguousAddressWarningambiguous address

NameResolution​

CodeLegacy codeNameSeverityMessage
EC03001E03001AddressWithoutValueNonblockingErroraddress with no value
EC03002E03002UnboundModuleBlockingErrorunbound module
EC03003E03003UnboundModuleMemberBlockingErrorunbound module member
EC03004E03004UnboundTypeBlockingErrorunbound type
EC03005E03005UnboundUnscopedNameBlockingErrorunbound unscoped name
EC03006E03006NamePositionMismatchBlockingErrorunexpected name in this position
EC03007E03007TooManyTypeArgumentsNonblockingErrortoo many type arguments
EC03008E03008TooFewTypeArgumentsBlockingErrortoo few type arguments
EC03009E03009UnboundVariableBlockingErrorunbound variable
EC03010E03010UnboundFieldNonblockingErrorunbound field
EC03011E03011ReservedNameBlockingErrorinvalid use of reserved name
EC03012E03012UnboundMacroBlockingErrorunbound macro
EC03013E03013PositionalCallMismatchNonblockingErrorpositional call mismatch
EC03014E03014InvalidLabelBlockingErrorinvalid use of label
EC03015E03015UnboundLabelBlockingErrorunbound label
EC03016E03016InvalidMutNonblockingErrorinvalid 'mut' declaration
EC03017E03017InvalidMacroParameterNonblockingErrorinvalid macro parameter
EC03018E03018InvalidTypeParameterNonblockingErrorinvalid type parameter
EC03019E03019InvalidPatternBlockingErrorinvalid pattern
EC03020E03020UnboundVariantBlockingErrorunbound variant
EC03021E03021InvalidTypeAnnotationNonblockingErrorinvalid type annotation
EC03022E03022InvalidPositionNonblockingErrorinvalid usage position

TypeSafety​

CodeLegacy codeNameSeverityMessage
EC04001E04001VisibilityNonblockingErrorrestricted visibility
EC04002E04002ScriptContextNonblockingErrorrequires script context
EC04003E04003BuiltinOperationBlockingErrorbuilt-in operation not supported
EC04004E04004ExpectedBaseTypeBlockingErrorexpected a single non-reference type
EC04005E04005ExpectedSingleTypeBlockingErrorexpected a single type
EC04006E04006SubtypeErrorBlockingErrorinvalid subtype
EC04007E04007JoinErrorBlockingErrorincompatible types
EC04008E04008RecursiveTypeBlockingErrorrecursive type not allowed
EC04009E04009ExpectedSpecificTypeBlockingErrorexpected specific type
EC04010E04010UninferredTypeBlockingErrorcannot infer type
EC04011E04011ScriptSignatureNonblockingErrorinvalid script signature
EC04012E04012TypeForConstantBlockingErrorinvalid type for constant
EC04013E04013UnsupportedConstantBlockingErrorinvalid statement or expression in constant
EC04014E04014InvalidLoopControlBlockingErrorinvalid loop control
EC04015E04015InvalidNativeUsageBlockingErrorinvalid use of native item
EC04016E04016TooFewArgumentsNonblockingErrortoo few arguments
EC04017E04017TooManyArgumentsNonblockingErrortoo many arguments
EC04018E04018CyclicDataNonblockingErrorcyclic data
EC04019E04019CyclicInstantiationNonblockingErrorcyclic type instantiation
EC04020E04020DeprecatedMissingAcquiresNonblockingErrorDEPRECATED. missing acquires annotation
EC04021E04021InvalidNumNonblockingErrornumeric literal out of range
EC04022E04022InvalidMethodCallBlockingErrorinvalid method call
EC04023E04023InvalidImmVariableUsageNonblockingErrorinvalid usage of immutable variable
EC04024E04024InvalidControlFlowBlockingErrorinvalid control flow
EC04025E04025InvalidCopyOpNonblockingErrorinvalid 'copy' usage
EC04026E04026InvalidMoveOpNonblockingErrorinvalid 'move' usage
WC04027W04027ImplicitConstantCopyWarningimplicit copy of a constant
EC04028E04028InvalidCallTargetBlockingErrorinvalid function call
EC04029E04029UnexpectedFunctionTypeBlockingErrorinvalid usage of lambda type
EC04030E04030UnexpectedLambdaBlockingErrorinvalid usage of lambda
EC04031E04031CannotExpandMacroBlockingErrorunable to expand macro function
EC04032E04032InvariantErrorBlockingErrortypes are not equal
EC04033E04033IncompatibleSyntaxMethodsBlockingError'syntax' method types differ
EC04034E04034InvalidErrorUsageBlockingErrorinvalid constant usage in error context
EC04035E04035IncompletePatternBlockingErrornon-exhaustive pattern
WC04036W04036DeprecatedUsageWarningdeprecated usage
EC04037E04037InvalidStringNonblockingErrorinvalid string after type inference
WC04038W04038MissingLiteralTypeWarningunable to determine literal's type

AbilitySafety​

CodeLegacy codeNameSeverityMessage
EC05001E05001ConstraintNonblockingErrorability constraint not satisfied
EC05002E05002ImplicitlyCopyableNonblockingErrortype not implicitly copyable

MoveSafety​

CodeLegacy codeNameSeverityMessage
EC06001E06001UnusedUndroppableNonblockingErrorunused value without 'drop'
EC06002E06002UnassignedVariableNonblockingErroruse of unassigned variable

ReferenceSafety​

CodeLegacy codeNameSeverityMessage
EC07001E07001RefTransBlockingErrorreferential transparency violated
EC07002E07002MutOwnsNonblockingErrormutable borrow rule violated
EC07003E07003DanglingNonblockingErrorinvalid operation, could create a dangling reference
EC07004E07004InvalidReturnNonblockingErrorinvalid return of locally borrowed state
EC07005E07005InvalidTransferNonblockingErrorinvalid reference transfer
EC07006E07006AmbiguousVariableUsageNonblockingErrorambiguous variable usage

CodeGeneration​

CodeLegacy codeNameSeverityMessage
EC08001E08001UnfoldableConstantNonblockingErrorcannot compute constant value
WC08002W08002AlwaysErrorsWarningoperation always errors

UnusedItem​

CodeLegacy codeNameSeverityMessage
WC09001W09001AliasWarningunused alias
WC09002W09002VariableWarningunused variable
WC09003W09003AssignmentWarningunused assignment
WC09004W09004TrailingSemiWarningunnecessary trailing semicolon
WC09005W09005DeadCodeWarningdead or unreachable code
WC09006W09006StructTypeParamWarningunused struct type parameter
WC09007W09007AttributeWarningunused attribute
WC09008W09008FunctionWarningunused function
WC09009W09009StructFieldWarningunused struct field
WC09010W09010FunTypeParamWarningunused function type parameter
WC09011W09011ConstantWarningunused constant
WC09012W09012MutModifierWarningunused 'mut' modifiers
WC09013W09013MutReferenceWarningunused mutable reference '&mut'
WC09014W09014MutParamWarningunused mutable reference '&mut' parameter

Attributes​

CodeLegacy codeNameSeverityMessage
EC10001E10001DuplicateNonblockingErrorinvalid duplicate attribute
EC10002E10002InvalidNameNonblockingErrorinvalid attribute name
EC10003E10003InvalidValueNonblockingErrorinvalid attribute value
EC10004E10004InvalidUsageNonblockingErrorinvalid usage of known attribute
EC10005E10005InvalidTestNonblockingErrorunable to generate test
EC10006E10006InvalidBytecodeInstNonblockingErrorunknown bytecode instruction function
WC10007W10007ValueWarningWarningissue with attribute value
EC10008E10008AmbiguousAttributeValueNonblockingErrorambiguous attribute value
WC10009W10009UnfulfilledExpectationWarningunfulfilled '#[expect(...)]'

Tests​

CodeLegacy codeNameSeverityMessage
EC11001E11001TestFailedBlockingErrortest failure

Bug​

CodeLegacy codeNameSeverityMessage
ICEC12001ICE12001BytecodeGenerationBugBYTECODE GENERATION FAILED
ICEC12002ICE12002BytecodeVerificationBugBYTECODE VERIFICATION FAILED
ICEC12003ICE12003ICEBugINTERNAL COMPILER ERROR

Editions​

CodeLegacy codeNameSeverityMessage
EC13001E13001FeatureTooNewNonblockingErrorfeature is not supported in specified edition
EC13002E13002DeprecatedFeatureNonblockingErrorfeature is deprecated in specified edition
EC13003E13003FeatureInDevelopmentBlockingErrorfeature is under active development

Migration​

CodeLegacy codeNameSeverityMessage
EC14001E14001NeedsPublicNonblockingErrormove 2024 migration: public struct
EC14002E14002NeedsLetMutNonblockingErrormove 2024 migration: let mut
EC14003E14003NeedsRestrictedIdentifierNonblockingErrormove 2024 migration: restricted identifier
EC14004E14004NeedsGlobalQualificationNonblockingErrormove 2024 migration: global qualification
EC14005E14005RemoveFriendNonblockingErrormove 2024 migration: remove 'friend'
EC14006E14006MakePubPackageNonblockingErrormove 2024 migration: make 'public(package)'
EC14007E14007AddressRemoveNonblockingErrormove 2024 migration: address remove
EC14008E14008AddressAddNonblockingErrormove 2024 migration: address add

IDE​

CodeLegacy codeNameSeverityMessage
EC15001E15001DotAutocompleteNoteIDE dot autocomplete
EC15002E15002MacroCallInfoNoteIDE macro call info
EC15003E15003ExpandedLambdaNoteIDE expanded lambda
EC15004E15004MissingMatchArmsNoteIDE missing match arms
EC15005E15005EllipsisExpansionNoteIDE ellipsis expansion
EC15006E15006PathAutocompleteNoteIDE path autocomplete
EC15007E15007StringValueNoteIDE string value

Lints​

A lint is a warning the compiler reports by its filter name, which is also how the #[allow(lint(...))] attribute names it. Suppress one for a function or a module with the attribute in the last column.

Sui lints​

FilterCategoryDescriptionSuppress with
share_ownedSuspiciouspossible owned object share#[allow(lint(share_owned))]
self_transferConventionsnon-composable transfer to sender#[allow(lint(self_transfer))]
custom_state_changeSuspiciouspotentially unenforceable custom transfer/share/freeze policy#[allow(lint(custom_state_change))]
coin_fieldConventionssub-optimal 'sui::coin::Coin' field type#[allow(lint(coin_field))]
freeze_wrappedSuspiciousattempting to freeze wrapped objects#[allow(lint(freeze_wrapped))]
collection_equalitySuspiciouspossibly useless collections compare#[allow(lint(collection_equality))]
public_randomSecurityrisky use of 'sui::random'#[allow(lint(public_random))]
missing_keySuspiciousstruct with id but missing key ability#[allow(lint(missing_key))]
freezing_capabilitySuspiciousfreezing potential capability#[allow(lint(freezing_capability))]
prefer_mut_tx_contextConventionsprefer '&mut TxContext' over '&TxContext'#[allow(lint(prefer_mut_tx_context))]
public_entryComplexityunnecessary `entry` on a `public` function#[allow(lint(public_entry))]
uncallable_functionCorrectnessit will not be possible to call this function#[allow(lint(uncallable_function))]
unused_object_with_fieldsSuspiciousunused object with fields#[allow(lint(unused_object_with_fields))]

Move lints​

FilterCategoryDescriptionSuppress with
constant_namingStyleconstant should follow naming convention#[allow(lint(constant_naming))]
while_trueStyleunnecessary 'while (true)', replace with 'loop'#[allow(lint(while_true))]
unnecessary_mathComplexitymath operator can be simplified#[allow(lint(unnecessary_math))]
unneeded_returnStyleunneeded return#[allow(lint(unneeded_return))]
abort_without_constantStyle'abort' or 'assert' without named constant#[allow(lint(abort_without_constant))]
loop_without_exitSuspicious'loop' without 'break' or 'return'#[allow(lint(loop_without_exit))]
unnecessary_conditionalComplexity'if' expression can be removed#[allow(lint(unnecessary_conditional))]
self_assignmentSuspiciousassignment preserves the same value#[allow(lint(self_assignment))]
redundant_ref_derefComplexityredundant reference/dereference#[allow(lint(redundant_ref_deref))]
unnecessary_unitStyleunit `()` expression can be removed or simplified#[allow(lint(unnecessary_unit))]
always_equal_operandsSuspiciousredundant, always-equal operands for binary operation#[allow(lint(always_equal_operands))]
combinable_comparisonsComplexitycomparison operations condition can be simplified#[allow(lint(combinable_comparisons))]
unused_return_valueSuspiciousreturn value of a non-mutating call is discarded#[allow(lint(unused_return_value))]
mutation_in_match_guardSuspiciousmutation in match guard#[allow(lint(mutation_in_match_guard))]