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: ErrorCode

Source

pub const INVALID_INTEGER: ErrorCode

Source

pub const INVALID_STRING_ESCAPE: ErrorCode

Source

pub const UNTERMINATED_STRING: ErrorCode

Source

pub const INVALID_FLOAT: ErrorCode

Source

pub const UNEXPECTED_TOKEN: ErrorCode

Source

pub const UNEXPECTED_EOF: ErrorCode

Source

pub const PARSE_ERROR: ErrorCode

Source

pub const NO_MAIN_FUNCTION: ErrorCode

Source

pub const UNDEFINED_VARIABLE: ErrorCode

Source

pub const UNDEFINED_FUNCTION: ErrorCode

Source

pub const ASSIGN_TO_IMMUTABLE: ErrorCode

Source

pub const UNKNOWN_TYPE: ErrorCode

Source

pub const USE_AFTER_MOVE: ErrorCode

Source

pub const TYPE_MISMATCH: ErrorCode

Source

pub const WRONG_ARGUMENT_COUNT: ErrorCode

Source

pub const MISSING_FIELDS: ErrorCode

Source

pub const UNKNOWN_FIELD: ErrorCode

Source

pub const DUPLICATE_FIELD: ErrorCode

Source

pub const COPY_STRUCT_NON_COPY_FIELD: ErrorCode

Source

pub const RESERVED_TYPE_NAME: ErrorCode

Source

pub const DUPLICATE_TYPE_DEFINITION: ErrorCode

Source

pub const LINEAR_VALUE_NOT_CONSUMED: ErrorCode

Source

pub const LINEAR_STRUCT_COPY: ErrorCode

Source

pub const HANDLE_STRUCT_MISSING_METHOD: ErrorCode

Source

pub const HANDLE_METHOD_WRONG_SIGNATURE: ErrorCode

Source

pub const DUPLICATE_METHOD: ErrorCode

Source

pub const UNDEFINED_METHOD: ErrorCode

Source

pub const UNDEFINED_ASSOC_FN: ErrorCode

Source

pub const METHOD_CALL_ON_NON_STRUCT: ErrorCode

Source

pub const METHOD_CALLED_AS_ASSOC_FN: ErrorCode

Source

pub const ASSOC_FN_CALLED_AS_METHOD: ErrorCode

Source

pub const DUPLICATE_DESTRUCTOR: ErrorCode

Source

pub const DESTRUCTOR_UNKNOWN_TYPE: ErrorCode

Source

pub const DUPLICATE_CONSTANT: ErrorCode

Source

pub const CONST_EXPR_NOT_SUPPORTED: ErrorCode

Source

pub const DUPLICATE_VARIANT: ErrorCode

Source

pub const UNKNOWN_VARIANT: ErrorCode

Source

pub const UNKNOWN_ENUM_TYPE: ErrorCode

Source

pub const FIELD_WRONG_ORDER: ErrorCode

Source

pub const FIELD_ACCESS_ON_NON_STRUCT: ErrorCode

Source

pub const INVALID_ASSIGNMENT_TARGET: ErrorCode

Source

pub const INOUT_NON_LVALUE: ErrorCode

Source

pub const INOUT_EXCLUSIVE_ACCESS: ErrorCode

Source

pub const BORROW_NON_LVALUE: ErrorCode

Source

pub const MUTATE_BORROWED_VALUE: ErrorCode

Source

pub const MOVE_OUT_OF_BORROW: ErrorCode

Source

pub const BORROW_INOUT_CONFLICT: ErrorCode

Source

pub const INOUT_KEYWORD_MISSING: ErrorCode

Source

pub const BORROW_KEYWORD_MISSING: ErrorCode

Source

pub const EMPTY_STRUCT: ErrorCode

Source

pub const BREAK_OUTSIDE_LOOP: ErrorCode

Source

pub const CONTINUE_OUTSIDE_LOOP: ErrorCode

Source

pub const INTRINSIC_REQUIRES_CHECKED: ErrorCode

Source

pub const UNCHECKED_CALL_REQUIRES_CHECKED: ErrorCode

Source

pub const NON_EXHAUSTIVE_MATCH: ErrorCode

Source

pub const EMPTY_MATCH: ErrorCode

Source

pub const INVALID_MATCH_TYPE: ErrorCode

Source

pub const UNKNOWN_INTRINSIC: ErrorCode

Source

pub const INTRINSIC_WRONG_ARG_COUNT: ErrorCode

Source

pub const INTRINSIC_TYPE_MISMATCH: ErrorCode

Source

pub const IMPORT_REQUIRES_STRING_LITERAL: ErrorCode

Source

pub const MODULE_NOT_FOUND: ErrorCode

Source

pub const STD_LIB_NOT_FOUND: ErrorCode

Source

pub const PRIVATE_MEMBER_ACCESS: ErrorCode

Source

pub const UNKNOWN_MODULE_MEMBER: ErrorCode

Source

pub const LITERAL_OUT_OF_RANGE: ErrorCode

Source

pub const CANNOT_NEGATE_UNSIGNED: ErrorCode

Source

pub const CHAINED_COMPARISON: ErrorCode

Source

pub const INDEX_ON_NON_ARRAY: ErrorCode

Source

pub const ARRAY_LENGTH_MISMATCH: ErrorCode

Source

pub const INDEX_OUT_OF_BOUNDS: ErrorCode

Source

pub const TYPE_ANNOTATION_REQUIRED: ErrorCode

Source

pub const MOVE_OUT_OF_INDEX: ErrorCode

Source

pub const UNSUPPORTED_TARGET: ErrorCode

Source

pub const PREVIEW_FEATURE_REQUIRED: ErrorCode

Source

pub const COMPTIME_EVALUATION_FAILED: ErrorCode

Source

pub const COMPTIME_ARG_NOT_CONST: ErrorCode

Source

pub const COMPTIME_USER_ERROR: ErrorCode

Source

pub const INTERNAL_ERROR: ErrorCode

Source

pub const INTERNAL_CODEGEN_ERROR: ErrorCode

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<(), Error>

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

impl Display for ErrorCode

Source§

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

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

impl Hash for ErrorCode

Source§

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

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
§

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

§

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

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

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

§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

§

type Proj<U: 'src> = U

§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<'p, T> Seq<'p, T> for T
where T: Clone,

§

type Item<'a> = &'a T where T: 'a

The item yielded by the iterator.
§

type Iter<'a> = Once<&'a T> where T: 'a

An iterator over the items within this container, by reference.
§

fn seq_iter(&self) -> <T as Seq<'p, T>>::Iter<'_>

Iterate over the elements of the container.
§

fn contains(&self, val: &T) -> bool
where T: PartialEq,

Check whether an item is contained within this sequence.
§

fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>
where 'p: 'b,

Convert an item of the sequence into a [MaybeRef].
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> OrderedSeq<'_, T> for T
where T: Clone,