Tracking the diagnostic struct transition

This is a list of items that should be checked off before calling the diagnostic struct transition complete.

When the above items are completed, we can make progress on these:

  • Change all Result<T, Error>-returns to Result<T, Diagnostic>. All Errors should be Error::SpadeDiagnostic at this point.
  • Remove all enum Error.
    • We still want some enum Error, e.g. when returning errors from symtab lookups. Instead we add some impl From<XYZError> for Diagnostic.
  • Remove the thiserror-glue in spade-diagnostics/src/emitter/mod.rs.
  • Remove the thiserror dependency 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