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: ErrorCode
pub const INVALID_INTEGER: ErrorCode
pub const INVALID_STRING_ESCAPE: ErrorCode
pub const UNTERMINATED_STRING: ErrorCode
pub const INVALID_FLOAT: ErrorCode
pub const UNEXPECTED_TOKEN: ErrorCode
pub const UNEXPECTED_EOF: ErrorCode
pub const PARSE_ERROR: ErrorCode
pub const NO_MAIN_FUNCTION: ErrorCode
pub const UNDEFINED_VARIABLE: ErrorCode
pub const UNDEFINED_FUNCTION: ErrorCode
pub const ASSIGN_TO_IMMUTABLE: ErrorCode
pub const UNKNOWN_TYPE: ErrorCode
pub const USE_AFTER_MOVE: ErrorCode
pub const TYPE_MISMATCH: ErrorCode
pub const WRONG_ARGUMENT_COUNT: ErrorCode
pub const MISSING_FIELDS: ErrorCode
pub const UNKNOWN_FIELD: ErrorCode
pub const DUPLICATE_FIELD: ErrorCode
pub const COPY_STRUCT_NON_COPY_FIELD: ErrorCode
pub const RESERVED_TYPE_NAME: ErrorCode
pub const DUPLICATE_TYPE_DEFINITION: ErrorCode
pub const LINEAR_VALUE_NOT_CONSUMED: ErrorCode
pub const LINEAR_STRUCT_COPY: ErrorCode
pub const HANDLE_STRUCT_MISSING_METHOD: ErrorCode
pub const HANDLE_METHOD_WRONG_SIGNATURE: ErrorCode
pub const DUPLICATE_METHOD: ErrorCode
pub const UNDEFINED_METHOD: ErrorCode
pub const UNDEFINED_ASSOC_FN: ErrorCode
pub const METHOD_CALL_ON_NON_STRUCT: ErrorCode
pub const METHOD_CALLED_AS_ASSOC_FN: ErrorCode
pub const ASSOC_FN_CALLED_AS_METHOD: ErrorCode
pub const DUPLICATE_DESTRUCTOR: ErrorCode
pub const DESTRUCTOR_UNKNOWN_TYPE: ErrorCode
pub const DUPLICATE_CONSTANT: ErrorCode
pub const CONST_EXPR_NOT_SUPPORTED: ErrorCode
pub const DUPLICATE_VARIANT: ErrorCode
pub const UNKNOWN_VARIANT: ErrorCode
pub const UNKNOWN_ENUM_TYPE: ErrorCode
pub const FIELD_WRONG_ORDER: ErrorCode
pub const FIELD_ACCESS_ON_NON_STRUCT: ErrorCode
pub const INVALID_ASSIGNMENT_TARGET: ErrorCode
pub const INOUT_NON_LVALUE: ErrorCode
pub const INOUT_EXCLUSIVE_ACCESS: ErrorCode
pub const BORROW_NON_LVALUE: ErrorCode
pub const MUTATE_BORROWED_VALUE: ErrorCode
pub const MOVE_OUT_OF_BORROW: ErrorCode
pub const BORROW_INOUT_CONFLICT: ErrorCode
pub const INOUT_KEYWORD_MISSING: ErrorCode
pub const BORROW_KEYWORD_MISSING: ErrorCode
pub const EMPTY_STRUCT: ErrorCode
pub const BREAK_OUTSIDE_LOOP: ErrorCode
pub const CONTINUE_OUTSIDE_LOOP: ErrorCode
pub const INTRINSIC_REQUIRES_CHECKED: ErrorCode
pub const UNCHECKED_CALL_REQUIRES_CHECKED: ErrorCode
pub const NON_EXHAUSTIVE_MATCH: ErrorCode
pub const EMPTY_MATCH: ErrorCode
pub const INVALID_MATCH_TYPE: ErrorCode
pub const UNKNOWN_INTRINSIC: ErrorCode
pub const INTRINSIC_WRONG_ARG_COUNT: ErrorCode
pub const INTRINSIC_TYPE_MISMATCH: ErrorCode
pub const IMPORT_REQUIRES_STRING_LITERAL: ErrorCode
pub const MODULE_NOT_FOUND: ErrorCode
pub const STD_LIB_NOT_FOUND: ErrorCode
pub const PRIVATE_MEMBER_ACCESS: ErrorCode
pub const UNKNOWN_MODULE_MEMBER: ErrorCode
pub const LITERAL_OUT_OF_RANGE: ErrorCode
pub const CANNOT_NEGATE_UNSIGNED: ErrorCode
pub const CHAINED_COMPARISON: ErrorCode
pub const INDEX_ON_NON_ARRAY: ErrorCode
pub const ARRAY_LENGTH_MISMATCH: ErrorCode
pub const INDEX_OUT_OF_BOUNDS: ErrorCode
pub const TYPE_ANNOTATION_REQUIRED: ErrorCode
pub const MOVE_OUT_OF_INDEX: ErrorCode
pub const LINK_ERROR: ErrorCode
pub const UNSUPPORTED_TARGET: ErrorCode
pub const PREVIEW_FEATURE_REQUIRED: ErrorCode
pub const COMPTIME_EVALUATION_FAILED: ErrorCode
pub const COMPTIME_ARG_NOT_CONST: ErrorCode
pub const COMPTIME_USER_ERROR: ErrorCode
pub const INTERNAL_ERROR: ErrorCode
pub const INTERNAL_CODEGEN_ERROR: ErrorCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
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,
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].