pub struct CompileError { /* private fields */ }Expand description
Compiler failure.
Failures carry structured data, not just display text: kind
is the stable category, location the source range when
one is known, and message the text without any location
prefix. Compilation is chunk-name-agnostic — a chunk name is bound when a
compiled chunk is loaded into a VM — so a compile error carries no chunk
name; an embedder prefixes its own.
Implementations§
Source§impl CompileError
impl CompileError
Sourcepub fn new(message: impl Into<String>) -> Self
pub fn new(message: impl Into<String>) -> Self
An CompileErrorKind::Internal error with no location: a compiler
limit or invariant, not a source-text fault. Public so layers above the
compiler (artifact validation of a freshly compiled chunk) can report
their own internal failures in the compiler’s error vocabulary.
Sourcepub fn kind(&self) -> CompileErrorKind
pub fn kind(&self) -> CompileErrorKind
Stable error category.
Trait Implementations§
Source§impl Clone for CompileError
impl Clone for CompileError
Source§impl Debug for CompileError
impl Debug for CompileError
Source§impl Display for CompileError
impl Display for CompileError
impl Eq for CompileError
Source§impl Error for CompileError
impl Error for CompileError
1.30.0 · 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()
Source§impl PartialEq for CompileError
impl PartialEq for CompileError
impl StructuralPartialEq for CompileError
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