rust/tests
Nicholas Nethercote f6f8779843 Reduce capabilities of Diagnostic.
Currently many diagnostic modifier methods are available on both
`Diagnostic` and `DiagnosticBuilder`. This commit removes most of them
from `Diagnostic`. To minimize the diff size, it keeps them within
`diagnostic.rs` but changes the surrounding `impl Diagnostic` block to
`impl DiagnosticBuilder`. (I intend to move things around later, to give
a more sensible code layout.)

`Diagnostic` keeps a few methods that it still needs, like `sub`,
`arg`, and `replace_args`.

The `forward!` macro, which defined two additional methods per call
(e.g. `note` and `with_note`), is replaced by the `with_fn!` macro,
which defines one additional method per call (e.g. `with_note`). It's
now also only used when necessary -- not all modifier methods currently
need a `with_*` form. (New ones can be easily added as necessary.)

All this also requires changing `trait AddToDiagnostic` so its methods
take `DiagnosticBuilder` instead of `Diagnostic`, which leads to many
mechanical changes. `SubdiagnosticMessageOp` gains a type parameter `G`.

There are three subdiagnostics -- `DelayedAtWithoutNewline`,
`DelayedAtWithNewline`, and `InvalidFlushedDelayedDiagnosticLevel` --
that are created within the diagnostics machinery and appended to
external diagnostics. These are handled at the `Diagnostic` level, which
means it's now hard to construct them via `derive(Diagnostic)`, so
instead we construct them by hand. This has no effect on what they look
like when printed.

There are lots of new `allow` markers for `untranslatable_diagnostics`
and `diagnostics_outside_of_impl`. This is because
`#[rustc_lint_diagnostics]` annotations were present on the `Diagnostic`
modifier methods, but missing from the `DiagnosticBuilder` modifier
methods. They're now present.
2024-02-20 13:22:17 +11:00
..
assembly
auxiliary
codegen Auto merge of #118264 - lukas-code:optimized-draining, r=the8472 2024-02-18 00:03:39 +00:00
codegen-units
coverage coverage: Discard spans that fill the entire function body 2024-02-16 10:57:03 +11:00
coverage-run-rustdoc
debuginfo
incremental
mir-opt Rollup merge of #121039 - cjgillot:gvn-adjust, r=compiler-errors 2024-02-14 11:53:41 +01:00
pretty
run-make
run-make-fulldeps Make CodegenBackend::join_codegen infallible. 2024-02-17 10:51:35 +11:00
run-pass-valgrind
rustdoc Rollup merge of #121218 - ShoyuVanilla:fix-issue-76736, r=notriddle 2024-02-18 05:10:18 +01:00
rustdoc-gui
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui
ui Auto merge of #117772 - surechen:for_117448, r=petrochenkov 2024-02-18 13:56:07 +00:00
ui-fulldeps Reduce capabilities of Diagnostic. 2024-02-20 13:22:17 +11:00
COMPILER_TESTS.md