1
Fork 0

errors: lint on LintDiagnosticBuilder::build

Apply the `#[rustc_lint_diagnostics]` attribute to
`LintDiagnosticBuilder::build` so that diagnostic migration lints will
trigger for it.

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-07-11 16:29:24 +01:00
parent 06f480661f
commit c3fdf74885
4 changed files with 39 additions and 24 deletions

View file

@ -1,4 +1,4 @@
use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic};
use rustc_macros::{LintDiagnostic, SessionDiagnostic, SessionSubdiagnostic};
use rustc_span::{Span, Symbol};
#[derive(SessionDiagnostic)]
@ -73,3 +73,19 @@ pub struct InPublicInterface<'a> {
#[label(privacy::visibility_label)]
pub vis_span: Span,
}
#[derive(LintDiagnostic)]
#[lint(privacy::from_private_dep_in_public_interface)]
pub struct FromPrivateDependencyInPublicInterface<'a> {
pub kind: &'a str,
pub descr: String,
pub krate: Symbol,
}
#[derive(LintDiagnostic)]
#[lint(privacy::private_in_public_lint)]
pub struct PrivateInPublicLint<'a> {
pub vis_descr: &'static str,
pub kind: &'a str,
pub descr: String,
}