rust/compiler/rustc_codegen_ssa/src/back
Nicholas Nethercote d71f535a6f Rework how diagnostic lints are stored.
`Diagnostic::code` has the type `DiagnosticId`, which has `Error` and
`Lint` variants. Plus `Diagnostic::is_lint` is a bool, which should be
redundant w.r.t. `Diagnostic::code`.

Seems simple. Except it's possible for a lint to have an error code, in
which case its `code` field is recorded as `Error`, and `is_lint` is
required to indicate that it's a lint. This is what happens with
`derive(LintDiagnostic)` lints. Which means those lints don't have a
lint name or a `has_future_breakage` field because those are stored in
the `DiagnosticId::Lint`.

It's all a bit messy and confused and seems unintentional.

This commit:
- removes `DiagnosticId`;
- changes `Diagnostic::code` to `Option<String>`, which means both
  errors and lints can straightforwardly have an error code;
- changes `Diagnostic::is_lint` to `Option<IsLint>`, where `IsLint` is a
  new type containing a lint name and a `has_future_breakage` bool, so
  all lints can have those, error code or not.
2024-01-14 14:04:25 +11:00
..
rpath Handle non-utf8 rpaths (fix FIXME) 2023-08-03 20:04:18 +02:00
archive.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
command.rs Reduce usage of Symbol in the linker code 2022-06-28 18:38:36 +00:00
link.rs Auto merge of #119088 - George-lewis:glewis/suggest-upgrading-compiler, r=Nilstrieb 2024-01-13 20:06:03 +00:00
linker.rs Rename {create,emit}_warning as {create,emit}_warn. 2024-01-10 07:33:06 +11:00
lto.rs Merge new_metadata into codegen_allocator 2022-04-30 21:20:08 +02:00
metadata.rs Address comment 2023-12-18 09:41:36 +08:00
mod.rs Use the object crate for metadata reading 2021-05-07 18:48:58 +02:00
rpath.rs rustc_codegen_ssa: use try_canonicalize in rpath 2023-10-06 09:54:11 -04:00
symbol_export.rs Auto merge of #119409 - Kobzol:rustc-codegen-ssa-query-instability, r=Nilstrieb 2024-01-13 18:07:59 +00:00
write.rs Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00