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:
commit
1a93028bcc
9 changed files with 913 additions and 763 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue