1
Fork 0

Rollup merge of #101851 - Xiretza:diagnostic-derive-cleanups, r=davidtwco

Clean up (sub)diagnostic derives

The biggest chunk of this is unifying the parsing of subdiagnostic attributes (`#[error]`, `#[suggestion(...)]`, `#[label(...)]`, etc) between `Subdiagnostic` and `Diagnostic` type attributes as well as `Diagnostic` field attributes.

It also improves a number of proc macro diagnostics.

Waiting for #101558.
This commit is contained in:
fee1-dead 2022-09-26 09:27:36 +08:00 committed by GitHub
commit 1a93028bcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 913 additions and 763 deletions

View file

@ -462,7 +462,7 @@ pub struct LinkSection {
pub struct NoMangleForeign {
#[label]
pub span: Span,
#[suggestion(applicability = "machine-applicable")]
#[suggestion(code = "", applicability = "machine-applicable")]
pub attr_span: Span,
pub foreign_item_kind: &'static str,
}
@ -596,7 +596,7 @@ pub enum UnusedNote {
#[derive(LintDiagnostic)]
#[diag(passes::unused)]
pub struct Unused {
#[suggestion(applicability = "machine-applicable")]
#[suggestion(code = "", applicability = "machine-applicable")]
pub attr_span: Span,
#[subdiagnostic]
pub note: UnusedNote,