lint: add diagnostic translation migration lints
Introduce allow-by-default lints for checking whether diagnostics are written in `SessionDiagnostic`/`AddSubdiagnostic` impls and whether diagnostics are translatable. These lints can be denied for modules once they are fully migrated to impls and translation. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
52ee2a2738
commit
5ba81faba6
15 changed files with 327 additions and 37 deletions
|
@ -209,6 +209,7 @@ pub struct PerfStats {
|
|||
|
||||
/// Trait implemented by error types. This should not be implemented manually. Instead, use
|
||||
/// `#[derive(SessionDiagnostic)]` -- see [rustc_macros::SessionDiagnostic].
|
||||
#[rustc_diagnostic_item = "SessionDiagnostic"]
|
||||
pub trait SessionDiagnostic<'a, T: EmissionGuarantee = ErrorGuaranteed> {
|
||||
/// Write out as a diagnostic out of `sess`.
|
||||
#[must_use]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue