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 Bless/fix tests 2024-02-08 19:56:30 -05:00
auxiliary
codegen Auto merge of #118264 - lukas-code:optimized-draining, r=the8472 2024-02-18 00:03:39 +00:00
codegen-units Update tests 2024-02-07 10:42:01 +08:00
coverage coverage: Discard spans that fill the entire function body 2024-02-16 10:57:03 +11:00
coverage-run-rustdoc coverage: Don't instrument #[automatically_derived] functions 2024-01-22 12:18:57 +11:00
debuginfo Update tests. 2024-01-27 16:38:57 +01:00
incremental Auto merge of #120919 - oli-obk:impl_polarity, r=compiler-errors 2024-02-13 02:48:49 +00:00
mir-opt Rollup merge of #121039 - cjgillot:gvn-adjust, r=compiler-errors 2024-02-14 11:53:41 +01:00
pretty Auto merge of #120227 - nnethercote:further-improve-space_between, r=petrochenkov 2024-01-31 02:01:43 +00:00
run-make Update data layouts in custom target tests for LLVM 18 2024-01-31 15:15:59 +01:00
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 Add regression test for #120471 to ensure that long crate name are handled as expected on mobile 2024-01-31 16:40:23 +01:00
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui Clean inlined type alias with correct param-env 2024-02-12 04:51:49 +00:00
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