Tracking the diagnostic struct transition
This is a list of items that should be checked off before calling the diagnostic struct transition complete.
-
Create all current types of diagnostics using the API -
Errors -
Internal bugs -
Simple notes -
Simple help -
Spanned notes -
Spanned help -
Single suggestions -
Multipart suggestions
-
-
#[derive(Diagnostic)]( !129 (merged)) -
#[derive(Subdiagnostic)]and attach them to Diagnostics ( !138 (merged)) -
Porting all enum Errors to diagnostic structs-
ast-lowering (!159 (merged) and notably 4b43ed59) -
hir (!402 (merged)) -
hir-lowering (!402 (merged)) -
mir (!218 (merged)) -
parser (!281 (merged)) -
typeinference (!402 (merged))
-
When the above items are completed, we can make progress on these:
-
Change allResult<T, Error>-returns toResult<T, Diagnostic>. AllErrors should beError::SpadeDiagnosticat this point. -
Remove allenum Error.- We still want some
enum Error, e.g. when returning errors from symtab lookups. Instead we add someimpl From<XYZError> for Diagnostic.
- We still want some
-
Remove the thiserror-glue inspade-diagnostics/src/emitter/mod.rs. -
Remove thethiserrordependency completely? If it's not used anywhere else.
Not blocking the transition, but still part of what I'd consider left for the diagnostic structs feel "done" (at least for an initial push):
-
Loud footer when an internal bug is reported. -
Separate suggestions (and other subdiagnostics?) from the main diagnostic more.
Edited by Gustav Sörnäs