Crate gruel_error

Crate gruel_error 

Source
Expand description

Error types for the Gruel compiler.

This crate provides the error infrastructure used throughout the compilation pipeline. Errors carry source location information for diagnostic rendering.

§Diagnostic System

Errors and warnings can include rich diagnostic information:

  • Labels: Secondary spans pointing to related code locations
  • Notes: Informational context about the error/warning
  • Helps: Actionable suggestions for fixing the issue

Example:

CompileError::new(ErrorKind::TypeMismatch { ... }, span)
    .with_label("expected because of this", other_span)
    .with_help("consider using a type conversion")

Modules§

ice
Internal Compiler Error (ICE) handling.

Macros§

ice
Create an IceContext with automatic version and backtrace capture.
ice_error
Create a CompileError from an ICE context.

Structs§

CompileErrors
A collection of compilation errors.
CopyStructNonCopyFieldError
Payload for ErrorKind::CopyStructNonCopyField.
Diagnostic
Rich diagnostic information for errors and warnings.
DiagnosticWrapper
A compilation diagnostic (error or warning) with optional source location.
ErrorCode
A unique error code for each error type.
FieldWrongOrderError
Payload for ErrorKind::FieldWrongOrder.
Help
An actionable help suggestion.
IntrinsicTypeMismatchError
Payload for ErrorKind::IntrinsicTypeMismatch.
Label
A secondary label pointing to related code.
MissingFieldsError
Payload for ErrorKind::MissingFields.
Note
An informational note providing context.
ParsePreviewFeatureError
Error returned when parsing a preview feature name fails.
Suggestion
A suggested code fix that can be applied to resolve a diagnostic.

Enums§

Applicability
How confident we are that a suggested fix is correct.
ErrorKind
The kind of compilation error.
PreviewFeature
A preview feature that can be enabled with --preview.
WarningKind
The kind of compilation warning.

Traits§

OptionExt
Extension trait for converting Option<T> to CompileResult<T>.

Type Aliases§

CompileError
A compilation error with optional source location information.
CompileResult
Result type for compilation operations.
CompileWarning
A compilation warning with optional source location information.
MultiErrorResult
Result type for operations that can produce multiple errors.
PreviewFeatures
A set of enabled preview features.