ErrorCode

Struct ErrorCode 

Source
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: u16

Implementations§

Source§

impl ErrorCode

Source

pub const UNEXPECTED_CHARACTER: Self

Source

pub const INVALID_INTEGER: Self

Source

pub const INVALID_STRING_ESCAPE: Self

Source

pub const UNTERMINATED_STRING: Self

Source

pub const INVALID_FLOAT: Self

Source

pub const UNEXPECTED_TOKEN: Self

Source

pub const UNEXPECTED_EOF: Self

Source

pub const PARSE_ERROR: Self

Source

pub const NO_MAIN_FUNCTION: Self

Source

pub const UNDEFINED_VARIABLE: Self

Source

pub const UNDEFINED_FUNCTION: Self

Source

pub const ASSIGN_TO_IMMUTABLE: Self

Source

pub const UNKNOWN_TYPE: Self

Source

pub const USE_AFTER_MOVE: Self

Source

pub const TYPE_MISMATCH: Self

Source

pub const WRONG_ARGUMENT_COUNT: Self

Source

pub const MISSING_FIELDS: Self

Source

pub const UNKNOWN_FIELD: Self

Source

pub const DUPLICATE_FIELD: Self

Source

pub const COPY_STRUCT_NON_COPY_FIELD: Self

Source

pub const RESERVED_TYPE_NAME: Self

Source

pub const DUPLICATE_TYPE_DEFINITION: Self

Source

pub const LINEAR_VALUE_NOT_CONSUMED: Self

Source

pub const LINEAR_STRUCT_COPY: Self

Source

pub const HANDLE_STRUCT_MISSING_METHOD: Self

Source

pub const HANDLE_METHOD_WRONG_SIGNATURE: Self

Source

pub const DUPLICATE_METHOD: Self

Source

pub const UNDEFINED_METHOD: Self

Source

pub const UNDEFINED_ASSOC_FN: Self

Source

pub const METHOD_CALL_ON_NON_STRUCT: Self

Source

pub const METHOD_CALLED_AS_ASSOC_FN: Self

Source

pub const ASSOC_FN_CALLED_AS_METHOD: Self

Source

pub const DUPLICATE_DESTRUCTOR: Self

Source

pub const DESTRUCTOR_UNKNOWN_TYPE: Self

Source

pub const DUPLICATE_CONSTANT: Self

Source

pub const CONST_EXPR_NOT_SUPPORTED: Self

Source

pub const DUPLICATE_VARIANT: Self

Source

pub const UNKNOWN_VARIANT: Self

Source

pub const UNKNOWN_ENUM_TYPE: Self

Source

pub const FIELD_WRONG_ORDER: Self

Source

pub const FIELD_ACCESS_ON_NON_STRUCT: Self

Source

pub const INVALID_ASSIGNMENT_TARGET: Self

Source

pub const INOUT_NON_LVALUE: Self

Source

pub const INOUT_EXCLUSIVE_ACCESS: Self

Source

pub const BORROW_NON_LVALUE: Self

Source

pub const MUTATE_BORROWED_VALUE: Self

Source

pub const MOVE_OUT_OF_BORROW: Self

Source

pub const BORROW_INOUT_CONFLICT: Self

Source

pub const INOUT_KEYWORD_MISSING: Self

Source

pub const BORROW_KEYWORD_MISSING: Self

Source

pub const EMPTY_STRUCT: Self

Source

pub const BREAK_OUTSIDE_LOOP: Self

Source

pub const CONTINUE_OUTSIDE_LOOP: Self

Source

pub const INTRINSIC_REQUIRES_CHECKED: Self

Source

pub const UNCHECKED_CALL_REQUIRES_CHECKED: Self

Source

pub const NON_EXHAUSTIVE_MATCH: Self

Source

pub const EMPTY_MATCH: Self

Source

pub const INVALID_MATCH_TYPE: Self

Source

pub const UNKNOWN_INTRINSIC: Self

Source

pub const INTRINSIC_WRONG_ARG_COUNT: Self

Source

pub const INTRINSIC_TYPE_MISMATCH: Self

Source

pub const IMPORT_REQUIRES_STRING_LITERAL: Self

Source

pub const MODULE_NOT_FOUND: Self

Source

pub const STD_LIB_NOT_FOUND: Self

Source

pub const PRIVATE_MEMBER_ACCESS: Self

Source

pub const UNKNOWN_MODULE_MEMBER: Self

Source

pub const LITERAL_OUT_OF_RANGE: Self

Source

pub const CANNOT_NEGATE_UNSIGNED: Self

Source

pub const CHAINED_COMPARISON: Self

Source

pub const INDEX_ON_NON_ARRAY: Self

Source

pub const ARRAY_LENGTH_MISMATCH: Self

Source

pub const INDEX_OUT_OF_BOUNDS: Self

Source

pub const TYPE_ANNOTATION_REQUIRED: Self

Source

pub const MOVE_OUT_OF_INDEX: Self

Source

pub const UNSUPPORTED_TARGET: Self

Source

pub const PREVIEW_FEATURE_REQUIRED: Self

Source

pub const COMPTIME_EVALUATION_FAILED: Self

Source

pub const COMPTIME_ARG_NOT_CONST: Self

Source

pub const COMPTIME_USER_ERROR: Self

Source

pub const INTERNAL_ERROR: Self

Source

pub const INTERNAL_CODEGEN_ERROR: Self

Trait Implementations§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> ErrorCode

Returns a duplicate 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 ErrorCode

Source§

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

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

impl Display for ErrorCode

Source§

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

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

impl Hash for ErrorCode

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 ErrorCode

Source§

fn eq(&self, other: &ErrorCode) -> 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 Copy for ErrorCode

Source§

impl Eq for ErrorCode

Source§

impl StructuralPartialEq for ErrorCode

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> 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§

fn to_string(&self) -> String

Converts the given value to a String. 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.