]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #99213 - davidtwco:translation-migrate-passes, r=compiler-errors
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 16 Jul 2022 20:30:48 +0000 (22:30 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Jul 2022 20:30:48 +0000 (22:30 +0200)
migrate some of `rustc_passes::check_attr`'s diagnostics and derive improvements

- Implements `IntoDiagnosticArg` for `char` using its `Debug` implementation and introduces a macro for those types which just delegate the implementation to `ToString`.
- Apply the `#[rustc_lint_diagnostics]` attribute to `LintDiagnosticBuilder::build` so that diagnostic migration lints will trigger for it - some diagnostics in `rustc_privacy` need updated after this since the lints apply to that crate.
- Add support for `MultiSpan` with any of the attributes that work on a `Span` in the diagnostic derive (`SessionDiagnostic` + `LintDiagnostic`). Requires that diagnostic logic generated for these attributes are emitted in the by-move block rather than the by-ref block that they would normally have been generated in.
- Both diagnostic and subdiagnostic derives were missing the ability to add warnings to diagnostics - this is made more difficult by the `warn` attribute already existing, so this name being unavailable for the derives to use. `#[warn_]` is used instead, which requires special-casing so that `{span_,}warn` is called instead of `{span_,}warn_`.
- Migrate half of the `rustc_passes::check_attr` diagnostics to using diagnostic derives and being translatable. I got tired after a while. I modified some diagnostic output for consistency while doing this, nothing too crazy.

r? `@compiler-errors`


Trivial merge