Skip to main content

Module diag

Module diag 

Source
Expand description

Diagnostics.

Macros§

eco_format
Create a new EcoString from a format string.
eco_vec
Create a new EcoVec with the given elements.

Structs§

EcoString
An economical string with inline storage and clone-on-write semantics.
EcoVec
An economical vector with clone-on-write semantics.
HintedString
A string message with hints. The recommended way to create one is with the error! macro.
LineCol
A line/column pair.
LoadError
A call site independent error that occurred during data loading. This avoids polluting the memoization with Spans and FileIds from source files. Can be turned into a SourceDiagnostic using the LoadedWithin::within method available on LoadResult.
SourceDiagnostic
An error or warning in a source or text file. The recommended way to create one is with the error! or warning! macros.
Warned
An output alongside warnings generated while producing it.

Enums§

FileError
An error that occurred while trying to load a file.
PackageError
An error that occurred while trying to load a package.
ReportTextPos
A position in a text document at which an error was reported.
Severity
The severity of a SourceDiagnostic.
Tracepoint
A part of a diagnostic’s trace.

Traits§

At
Convert a StrResult or HintedStrResult to a SourceResult by adding span information.
CollectCombinedResult
Collects an iterator of SourceResults into a result containg a collection or the accumulated errors.
ExpectInternal
Adds a method analogous to Option::expect that raises an internal compiler error instead of panicking.
Hint
Enrich a StrResult or HintedStrResult with a hint.
LoadedWithin
Convert a LoadError or compatible Result to a SourceDiagnostic or SourceResult by adding the Loaded context.
ParallelCollectCombinedResult
A variation of CollectCombinedResult for parallel rayon iterators.
Trace
Enrich a SourceResult with a tracepoint.
WarningSink
Destination for a warning message.

Functions§

assert_internal
Asserts a condition, generating an internal compiler error with the provided message on failure.
format_xml_like_error
Format a user-facing error message for an XML-like file format.
panic_internal
Generates an internal compiler error with the provided message.

Type Aliases§

FileResult
A result type with a file-related error.
HintedStrResult
A result type with a string error message and hints. The recommended way to create an error for this type is with the bail! macro.
LoadResult
A result type with a data-loading-related error.
PackageResult
A result type with a package-related error.
SourceResult
A result that can carry multiple source errors. The recommended way to create an error for this type is with the bail! macro.
StrResult
A result type with a string error message. The recommended way to create an error for this type is with the [bail!] macro.