pub enum CompileError {
Show 22 variants
UnexpectedChar {
ch: char,
line: usize,
col: usize,
span: Option<Span>,
},
UnterminatedString {
line: usize,
span: Option<Span>,
},
UnexpectedToken {
expected: String,
found: String,
span: Option<Span>,
},
SyntaxError {
message: String,
span: Option<Span>,
},
TypeMismatch {
expected: String,
found: String,
span: Option<Span>,
},
UndefinedVariable {
name: String,
span: Option<Span>,
},
UndefinedFunction {
name: String,
span: Option<Span>,
},
ArgumentCountMismatch {
name: String,
expected: usize,
found: usize,
span: Option<Span>,
},
CodegenError {
message: String,
},
IoError(Error),
Generic(String),
MissingSemicolon {
span: Option<Span>,
},
InvalidFunctionSignature {
message: String,
span: Option<Span>,
},
BorrowChecker {
message: String,
span: Option<Span>,
},
UseOfMovedValue {
name: String,
span: Option<Span>,
},
UseOfUninitializedValue {
name: String,
span: Option<Span>,
},
CannotMoveOutOfBorrowedContent {
span: Option<Span>,
},
UnsafeOperation {
operation: String,
span: Span,
},
ConflictingBorrows {
message: String,
span: Option<Span>,
},
LifetimeError {
message: String,
span: Option<Span>,
},
NonExhaustiveMatch {
missing_patterns: Vec<String>,
span: Option<Span>,
},
UnreachablePattern {
patterns: Vec<String>,
span: Option<Span>,
},
}Variants§
UnexpectedChar
UnterminatedString
UnexpectedToken
SyntaxError
TypeMismatch
UndefinedVariable
UndefinedFunction
ArgumentCountMismatch
CodegenError
IoError(Error)
Generic(String)
MissingSemicolon
InvalidFunctionSignature
BorrowChecker
UseOfMovedValue
UseOfUninitializedValue
CannotMoveOutOfBorrowedContent
UnsafeOperation
ConflictingBorrows
LifetimeError
NonExhaustiveMatch
UnreachablePattern
Implementations§
Source§impl CompileError
impl CompileError
Sourcepub fn to_diagnostic(&self) -> Diagnostic
pub fn to_diagnostic(&self) -> Diagnostic
Convert this error into a diagnostic with helpful suggestions
Trait Implementations§
Source§impl Debug for CompileError
impl Debug for CompileError
Source§impl Display for CompileError
impl Display for CompileError
Source§impl Error for CompileError
impl Error for CompileError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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()
Auto Trait Implementations§
impl Freeze for CompileError
impl !RefUnwindSafe for CompileError
impl Send for CompileError
impl Sync for CompileError
impl Unpin for CompileError
impl UnsafeUnpin for CompileError
impl !UnwindSafe for CompileError
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