about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-07-06 14:49:10 +0530
committerGitHub <noreply@github.com>2022-07-06 14:49:10 +0530
commitdf1f41530509308d4271f5b8204809e025293857 (patch)
tree7ec6ff3f05d000b730606be79d40a2bb354d7ab7 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent707c0d9a2d37da38b21222cd4b98e10a93a2643d (diff)
parent9d864c8d56fee09abae2be2bed1d4dc1a86b457b (diff)
downloadrust-df1f41530509308d4271f5b8204809e025293857.tar.gz
rust-df1f41530509308d4271f5b8204809e025293857.zip
Rollup merge of #98884 - davidtwco:translation-on-lints-derive, r=oli-obk
macros: `LintDiagnostic` derive

- Move `LintDiagnosticBuilder` into `rustc_errors` so that a diagnostic derive can refer to it.
- Introduce a `DecorateLint` trait, which is equivalent to `SessionDiagnostic` or `AddToDiagnostic` but for lints. Necessary without making more changes to the lint infrastructure as `DecorateLint` takes a `LintDiagnosticBuilder` and re-uses all of the existing logic for determining what type of diagnostic a lint should be emitted as (e.g. error/warning).
- Various refactorings of the diagnostic derive machinery (extracting `build_field_mapping` helper and moving `sess` field out of the `DiagnosticDeriveBuilder`).
- Introduce a `LintDiagnostic` derive macro that works almost exactly like the `SessionDiagnostic` derive macro  except that it derives a `DecorateLint` implementation instead. A new derive is necessary for this because `SessionDiagnostic` is intended for when the generated code creates the diagnostic. `AddToDiagnostic` could have been used but it would have required more changes to the lint machinery.

~~At time of opening this pull request, ignore all of the commits from #98624, it's just the last few commits that are new.~~

r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions