macros: support adding warnings to diags
Both diagnostic and subdiagnostic derives were missing the ability to add warnings to diagnostics - this is made more difficult by the `warn` attribute already existing, so this name being unavailable for the derives to use. `#[warn_]` is used instead, which requires special-casing so that `{span_,}warn` is called instead of `{span_,}warn_`. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
88c11c5bff
commit
81cf2294b4
8 changed files with 70 additions and 25 deletions
|
@ -130,8 +130,9 @@ decl_derive!(
|
|||
warning,
|
||||
error,
|
||||
lint,
|
||||
note,
|
||||
help,
|
||||
note,
|
||||
warn_,
|
||||
// field attributes
|
||||
skip_arg,
|
||||
primary_span,
|
||||
|
@ -148,8 +149,9 @@ decl_derive!(
|
|||
warning,
|
||||
error,
|
||||
lint,
|
||||
note,
|
||||
help,
|
||||
note,
|
||||
warn_,
|
||||
// field attributes
|
||||
skip_arg,
|
||||
primary_span,
|
||||
|
@ -166,6 +168,7 @@ decl_derive!(
|
|||
label,
|
||||
help,
|
||||
note,
|
||||
warn_,
|
||||
suggestion,
|
||||
suggestion_short,
|
||||
suggestion_hidden,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue