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
IceContextwith automatic version and backtrace capture. - ice_
error - Create a
CompileErrorfrom an ICE context.
Structs§
- Compile
Errors - A collection of compilation errors.
- Copy
Struct NonCopy Field Error - Payload for
ErrorKind::CopyStructNonCopyField. - Diagnostic
- Rich diagnostic information for errors and warnings.
- Diagnostic
Wrapper - A compilation diagnostic (error or warning) with optional source location.
- Error
Code - A unique error code for each error type.
- Field
Wrong Order Error - Payload for
ErrorKind::FieldWrongOrder. - Help
- An actionable help suggestion.
- Intrinsic
Type Mismatch Error - Payload for
ErrorKind::IntrinsicTypeMismatch. - Label
- A secondary label pointing to related code.
- Missing
Fields Error - Payload for
ErrorKind::MissingFields. - Note
- An informational note providing context.
- Parse
Preview Feature Error - 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.
- Error
Kind - The kind of compilation error.
- Preview
Feature - A preview feature that can be enabled with
--preview. - Warning
Kind - The kind of compilation warning.
Traits§
- Option
Ext - Extension trait for converting
Option<T>toCompileResult<T>.
Type Aliases§
- Compile
Error - A compilation error with optional source location information.
- Compile
Result - Result type for compilation operations.
- Compile
Warning - A compilation warning with optional source location information.
- Multi
Error Result - Result type for operations that can produce multiple errors.
- Preview
Features - A set of enabled preview features.