pub type CompileError = DiagnosticWrapper<ErrorKind>;Expand description
A compilation error with optional source location information.
Some errors (like NoMainFunction or LinkError) don’t have a meaningful
source location. Use has_span() to check before rendering location info.
Errors can include rich diagnostic information using the builder methods:
ⓘ
CompileError::new(ErrorKind::TypeMismatch { ... }, span)
.with_label("expected because of this", other_span)
.with_note("types must match exactly")
.with_help("consider adding a type conversion")Aliased Type§
pub struct CompileError {
pub kind: ErrorKind,
/* private fields */
}Fields§
§kind: ErrorKindThe specific kind of diagnostic.
Implementations§
Trait Implementations§
Source§impl From<CompileErrors> for CompileError
impl From<CompileErrors> for CompileError
Source§fn from(errors: CompileErrors) -> Self
fn from(errors: CompileErrors) -> Self
Convert a collection to a single error.
Uses the first error in the collection. If the collection is empty, returns an internal error (this indicates a compiler bug).