Enum debris_error::lang_error::LangErrorKind
source · pub enum LangErrorKind {
Show 22 variants
UnexpectedProperty {
property: String,
value_class: String,
},
TupleMismatch {
lhs_count: usize,
rhs_count: usize,
},
IndexOutOfBounds {
index: i32,
max: usize,
},
ImmutableProperty,
UnexpectedType {
expected: Vec<String>,
got: String,
declared: Option<Span>,
},
UnexpectedStructInitializer {
ident: Ident,
strukt: Ident,
available: Vec<Ident>,
},
MissingStructInitializer {
strukt: Ident,
missing: Vec<Ident>,
},
UnexpectedOverload {
parameters: Vec<String>,
expected: Vec<Vec<String>>,
function_definition_span: Option<Span>,
},
MissingVariable {
var_name: Ident,
similar: Vec<String>,
notes: Vec<String>,
},
NonComptimeVariable {
var_name: String,
class: String,
},
UnexpectedOperator {
operator: SpecialIdent,
lhs: String,
rhs: String,
},
MissingModule {
path: String,
error: ErrorKind,
},
CircularImport {
module: String,
},
InvalidControlFlow {
control_flow: String,
requires: ControlFlowRequires,
},
UnreachableCode,
NotYetImplemented {
msg: String,
},
ComptimeUpdate,
ComptimeCall,
InvalidComptimeBranch,
ContinueWithValue,
InvalidExternItemPath {
path: String,
error: String,
},
FunctionAlreadyExported,
}
Expand description
Specifies a specific error reason
Variants§
UnexpectedProperty
TupleMismatch
IndexOutOfBounds
ImmutableProperty
UnexpectedType
UnexpectedStructInitializer
MissingStructInitializer
UnexpectedOverload
MissingVariable
NonComptimeVariable
UnexpectedOperator
MissingModule
CircularImport
InvalidControlFlow
UnreachableCode
NotYetImplemented
ComptimeUpdate
ComptimeCall
InvalidComptimeBranch
ContinueWithValue
InvalidExternItemPath
FunctionAlreadyExported
Implementations§
source§impl LangErrorKind
impl LangErrorKind
fn get_snippet<'a>( &self, span: Span, ctx: &'a CompileContext ) -> LangErrorSnippet<'a>
Trait Implementations§
source§impl Clone for LangErrorKind
impl Clone for LangErrorKind
source§fn clone(&self) -> LangErrorKind
fn clone(&self) -> LangErrorKind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LangErrorKind
impl Debug for LangErrorKind
source§impl Display for LangErrorKind
impl Display for LangErrorKind
source§impl Error for LangErrorKind
impl Error for LangErrorKind
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl PartialEq for LangErrorKind
impl PartialEq for LangErrorKind
source§fn eq(&self, other: &LangErrorKind) -> bool
fn eq(&self, other: &LangErrorKind) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for LangErrorKind
impl StructuralEq for LangErrorKind
impl StructuralPartialEq for LangErrorKind
Auto Trait Implementations§
impl RefUnwindSafe for LangErrorKind
impl Send for LangErrorKind
impl Sync for LangErrorKind
impl Unpin for LangErrorKind
impl UnwindSafe for LangErrorKind
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.