rust/compiler
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
..
rustc Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_abi Avoid specialization for the Span Encodable and Decodable impls 2023-12-31 20:42:17 +00:00
rustc_arena rustc_arena: add alloc_str 2023-12-05 17:52:51 -08:00
rustc_ast Delegation implementation: step 1 2024-01-12 14:11:16 +03:00
rustc_ast_lowering Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00
rustc_ast_passes Auto merge of #119088 - George-lewis:glewis/suggest-upgrading-compiler, r=Nilstrieb 2024-01-13 20:06:03 +00:00
rustc_ast_pretty Delegation implementation: step 1 2024-01-12 14:11:16 +03:00
rustc_attr Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00
rustc_baked_icu_data Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_borrowck Stop using DiagnosticBuilder::buffer in BorrowckErrors. 2024-01-11 16:55:10 +11:00
rustc_builtin_macros Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00
rustc_codegen_cranelift Rollup merge of #117556 - obeis:static-mut-ref-lint, r=davidtwco 2024-01-09 13:23:15 +01:00
rustc_codegen_gcc Rename {create,emit}_warning as {create,emit}_warn. 2024-01-10 07:33:06 +11:00
rustc_codegen_llvm Revert "Auto merge of #113923 - DianQK:restore-no-builtins-lto, r=pnkfelix" 2024-01-12 18:23:04 +08:00
rustc_codegen_ssa Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_const_eval Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00
rustc_data_structures Rollup merge of #119527 - klensy:ordering, r=compiler-errors 2024-01-09 13:23:17 +01:00
rustc_driver Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_driver_impl Rename {create,emit}_warning as {create,emit}_warn. 2024-01-10 07:33:06 +11:00
rustc_error_codes Add error code for missing base expression in struct update syntax 2024-01-09 19:25:54 +00:00
rustc_error_messages Remove rustc_error_messages/messages.ftl. 2023-11-26 08:37:27 +11:00
rustc_errors Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_expand Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00
rustc_feature Rollup merge of #119866 - smoelius:patch-2, r=compiler-errors 2024-01-12 08:23:59 +01:00
rustc_fluent_macro annotate-snippets: update to 0.10 2024-01-07 16:53:32 +03:00
rustc_fs_util Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_graphviz remove unused pub fn 2023-11-23 14:11:02 +03:00
rustc_hir Delegation implementation: step 1 2024-01-12 14:11:16 +03:00
rustc_hir_analysis Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_hir_pretty Delegation implementation: step 1 2024-01-12 14:11:16 +03:00
rustc_hir_typeck Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_incremental Rename {create,emit}_warning as {create,emit}_warn. 2024-01-10 07:33:06 +11:00
rustc_index Auto merge of #119499 - cjgillot:dtm-opt, r=nnethercote 2024-01-06 11:54:15 +00:00
rustc_index_macros Put backticks around some attributes in doc comments. 2023-11-27 09:37:01 +11:00
rustc_infer Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_interface Auto merge of #119473 - Urgau:check-cfg-explicit-none, r=petrochenkov 2024-01-13 06:17:46 +00:00
rustc_lexer Rename some unescaping functions. 2023-12-13 14:17:50 +11:00
rustc_lint Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00
rustc_lint_defs Rollup merge of #117556 - obeis:static-mut-ref-lint, r=davidtwco 2024-01-09 13:23:15 +01:00
rustc_llvm Revert "Auto merge of #113923 - DianQK:restore-no-builtins-lto, r=pnkfelix" 2024-01-12 18:23:04 +08:00
rustc_log rustc_log: provide a way to init logging based on the values, not names, of the env vars 2023-11-11 15:24:33 +01:00
rustc_macros Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_metadata Auto merge of #119088 - George-lewis:glewis/suggest-upgrading-compiler, r=Nilstrieb 2024-01-13 20:06:03 +00:00
rustc_middle Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_mir_build Rollup merge of #119715 - Nadrieril:graceful-type-error, r=compiler-errors 2024-01-11 03:02:41 +01:00
rustc_mir_dataflow Remove movability from TyKind::Coroutine 2023-12-28 16:35:01 +00:00
rustc_mir_transform Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_monomorphize Stop mentioning internal lang items in no_std binary errors 2024-01-10 21:18:54 +01:00
rustc_next_trait_solver Remove movability from TyKind::Coroutine 2023-12-28 16:35:01 +00:00
rustc_parse Delegation implementation: step 1 2024-01-12 14:11:16 +03:00
rustc_parse_format Removing redudant note from parse error 2024-01-08 19:41:01 +01:00
rustc_passes Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_pattern_analysis Only lint ranges that really overlap 2024-01-11 14:04:11 +01:00
rustc_privacy Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
rustc_query_impl Rollup merge of #119527 - klensy:ordering, r=compiler-errors 2024-01-09 13:23:17 +01:00
rustc_query_system Add DiagCtxt::delayed_bug. 2024-01-10 07:33:07 +11:00
rustc_resolve Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_serialize Remove more needless leb128 coding for enum variants 2024-01-09 20:08:44 -05:00
rustc_session Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
rustc_smir Rollup merge of #119790 - celinval:smir-all-traits, r=oli-obk 2024-01-11 03:02:42 +01:00
rustc_span Auto merge of #118947 - Bryanskiy:delegStep1, r=petrochenkov,lcnr 2024-01-13 04:19:17 +00:00
rustc_symbol_mangling Rename consuming chaining methods on DiagnosticBuilder. 2024-01-10 07:40:00 +11:00
rustc_target Auto merge of #119927 - matthiaskrgr:rollup-885ws57, r=matthiaskrgr 2024-01-13 16:09:45 +00:00
rustc_trait_selection Auto merge of #119088 - George-lewis:glewis/suggest-upgrading-compiler, r=Nilstrieb 2024-01-13 20:06:03 +00:00
rustc_traits add unused NormalizesTo predicate 2023-12-07 17:52:51 +01:00
rustc_transmute Fix an ICE that occurs after an error has already been reported 2024-01-09 16:09:30 +00:00
rustc_ty_utils Rollup merge of #119587 - beepster4096:system_varargs, r=petrochenkov 2024-01-13 15:10:28 +01:00
rustc_type_ir Fix tidy error 2023-12-31 20:58:36 +00:00
stable_mir Rollup merge of #119877 - celinval:smir-visit-projection, r=oli-obk 2024-01-12 15:16:57 +01:00