pub struct ErrorCode(pub u16);Expand description
A unique error code for each error type.
Error codes are formatted as E followed by a 4-digit zero-padded number
(e.g., E0001, E0042). They are assigned by category:
- E0001-E0099: Lexer errors (tokenization)
- E0100-E0199: Parser errors (syntax)
- E0200-E0399: Semantic errors (types, names, scopes)
- E0400-E0499: Struct/enum errors
- E0500-E0599: Control flow errors
- E0600-E0699: Match errors
- E0700-E0799: Intrinsic errors
- E0800-E0899: Literal/operator errors
- E0900-E0999: Array errors
- E1000-E1099: Linker/target errors
- E1100-E1199: Preview feature errors
- E9000-E9999: Internal compiler errors
Once assigned, error codes must never change to maintain stability for documentation, search engines, and user bookmarks.
Tuple Fields§
§0: u16Implementations§
Source§impl ErrorCode
impl ErrorCode
pub const UNEXPECTED_CHARACTER: Self
pub const INVALID_INTEGER: Self
pub const INVALID_STRING_ESCAPE: Self
pub const UNTERMINATED_STRING: Self
pub const INVALID_FLOAT: Self
pub const UNEXPECTED_TOKEN: Self
pub const UNEXPECTED_EOF: Self
pub const PARSE_ERROR: Self
pub const NO_MAIN_FUNCTION: Self
pub const UNDEFINED_VARIABLE: Self
pub const UNDEFINED_FUNCTION: Self
pub const ASSIGN_TO_IMMUTABLE: Self
pub const UNKNOWN_TYPE: Self
pub const USE_AFTER_MOVE: Self
pub const TYPE_MISMATCH: Self
pub const WRONG_ARGUMENT_COUNT: Self
pub const MISSING_FIELDS: Self
pub const UNKNOWN_FIELD: Self
pub const DUPLICATE_FIELD: Self
pub const COPY_STRUCT_NON_COPY_FIELD: Self
pub const RESERVED_TYPE_NAME: Self
pub const DUPLICATE_TYPE_DEFINITION: Self
pub const LINEAR_VALUE_NOT_CONSUMED: Self
pub const LINEAR_STRUCT_COPY: Self
pub const HANDLE_STRUCT_MISSING_METHOD: Self
pub const HANDLE_METHOD_WRONG_SIGNATURE: Self
pub const DUPLICATE_METHOD: Self
pub const UNDEFINED_METHOD: Self
pub const UNDEFINED_ASSOC_FN: Self
pub const METHOD_CALL_ON_NON_STRUCT: Self
pub const METHOD_CALLED_AS_ASSOC_FN: Self
pub const ASSOC_FN_CALLED_AS_METHOD: Self
pub const DUPLICATE_DESTRUCTOR: Self
pub const DESTRUCTOR_UNKNOWN_TYPE: Self
pub const DUPLICATE_CONSTANT: Self
pub const CONST_EXPR_NOT_SUPPORTED: Self
pub const DUPLICATE_VARIANT: Self
pub const UNKNOWN_VARIANT: Self
pub const UNKNOWN_ENUM_TYPE: Self
pub const FIELD_WRONG_ORDER: Self
pub const FIELD_ACCESS_ON_NON_STRUCT: Self
pub const INVALID_ASSIGNMENT_TARGET: Self
pub const INOUT_NON_LVALUE: Self
pub const INOUT_EXCLUSIVE_ACCESS: Self
pub const BORROW_NON_LVALUE: Self
pub const MUTATE_BORROWED_VALUE: Self
pub const MOVE_OUT_OF_BORROW: Self
pub const BORROW_INOUT_CONFLICT: Self
pub const INOUT_KEYWORD_MISSING: Self
pub const BORROW_KEYWORD_MISSING: Self
pub const EMPTY_STRUCT: Self
pub const BREAK_OUTSIDE_LOOP: Self
pub const CONTINUE_OUTSIDE_LOOP: Self
pub const INTRINSIC_REQUIRES_CHECKED: Self
pub const UNCHECKED_CALL_REQUIRES_CHECKED: Self
pub const NON_EXHAUSTIVE_MATCH: Self
pub const EMPTY_MATCH: Self
pub const INVALID_MATCH_TYPE: Self
pub const UNKNOWN_INTRINSIC: Self
pub const INTRINSIC_WRONG_ARG_COUNT: Self
pub const INTRINSIC_TYPE_MISMATCH: Self
pub const IMPORT_REQUIRES_STRING_LITERAL: Self
pub const MODULE_NOT_FOUND: Self
pub const STD_LIB_NOT_FOUND: Self
pub const PRIVATE_MEMBER_ACCESS: Self
pub const UNKNOWN_MODULE_MEMBER: Self
pub const LITERAL_OUT_OF_RANGE: Self
pub const CANNOT_NEGATE_UNSIGNED: Self
pub const CHAINED_COMPARISON: Self
pub const INDEX_ON_NON_ARRAY: Self
pub const ARRAY_LENGTH_MISMATCH: Self
pub const INDEX_OUT_OF_BOUNDS: Self
pub const TYPE_ANNOTATION_REQUIRED: Self
pub const MOVE_OUT_OF_INDEX: Self
pub const LINK_ERROR: Self
pub const UNSUPPORTED_TARGET: Self
pub const PREVIEW_FEATURE_REQUIRED: Self
pub const COMPTIME_EVALUATION_FAILED: Self
pub const COMPTIME_ARG_NOT_CONST: Self
pub const COMPTIME_USER_ERROR: Self
pub const INTERNAL_ERROR: Self
pub const INTERNAL_CODEGEN_ERROR: Self
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnwindSafe for ErrorCode
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
Mutably borrows from an owned value. Read more