rust/compiler/rustc_codegen_ssa/src
bors 16f4b02dd8 Auto merge of #119922 - nnethercote:fix-Diag-code-is_lint, r=oli-obk
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.

r? `@oli-obk`
2024-01-17 07:33:52 +00:00
..
back Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
debuginfo Auto merge of #119258 - compiler-errors:closure-kind, r=eholk 2023-12-26 04:25:53 +00:00
mir compiler: Lower fn call arg spans down to MIR 2024-01-15 19:07:11 +01:00
traits Auto merge of #118705 - WaffleLapkin:codegen-atomic-exhange-untuple, r=cjgillot 2023-12-30 07:42:19 +00:00
assert_module_sources.rs rustc_codegen_ssa: Enforce rustc::potential_query_instability lint 2024-01-13 16:05:53 +01:00
base.rs Auto merge of #119409 - Kobzol:rustc-codegen-ssa-query-instability, r=Nilstrieb 2024-01-13 18:07:59 +00:00
codegen_attrs.rs Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00
common.rs move ConstValue into mir 2023-09-19 11:11:02 +02:00
errors.rs Rename consuming chaining methods on DiagnosticBuilder. 2024-01-10 07:40:00 +11:00
lib.rs Auto merge of #119409 - Kobzol:rustc-codegen-ssa-query-instability, r=Nilstrieb 2024-01-13 18:07:59 +00:00
meth.rs cg_ssa: remove pointee types and pointercast/bitcast-of-ptr 2023-07-29 13:18:20 -04:00
mono_item.rs Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
size_of_val.rs fix computing the dynamic alignment of packed structs with dyn trait tails 2023-12-13 20:21:57 +01:00
target_features.rs Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00