CompileError

Type Alias CompileError 

Source
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: ErrorKind

The specific kind of diagnostic.