Move mixed export_name/no_mangle check to check_attr.rs and improve the error

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This commit is contained in:
Jonathan Brouwer
2025-06-24 23:05:45 +02:00
parent 287d9afce7
commit 3d1cee5324
12 changed files with 133 additions and 81 deletions

View File

@@ -49,6 +49,18 @@ pub(crate) struct ConstContinueAttr {
pub node_span: Span,
}
#[derive(LintDiagnostic)]
#[diag(passes_mixed_export_name_and_no_mangle)]
pub(crate) struct MixedExportNameAndNoMangle {
#[label]
#[suggestion(style = "verbose", code = "", applicability = "machine-applicable")]
pub no_mangle_span: Span,
#[note]
pub export_name_span: Span,
pub no_mangle_attr: &'static str,
pub export_name_attr: &'static str,
}
#[derive(LintDiagnostic)]
#[diag(passes_outer_crate_level_attr)]
pub(crate) struct OuterCrateLevelAttr;