Point to previous applicability when declared multiple times

This commit is contained in:
Xiretza 2022-09-10 14:48:01 +02:00
parent ec85a1b263
commit efb20bc855
3 changed files with 19 additions and 26 deletions

View file

@ -436,7 +436,7 @@ struct ErrorWithNoteCustomWrongOrder {
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ApplicabilityInBoth {
#[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
//~^ ERROR applicability cannot be set in both the field and attribute
//~^ ERROR specified multiple times
suggestion: (Span, Applicability),
}

View file

@ -293,11 +293,17 @@ error: `#[label = ...]` is not a valid attribute
LL | #[label = "bar"]
| ^^^^^^^^^^^^^^^^
error: applicability cannot be set in both the field and attribute
error: specified multiple times
--> $DIR/diagnostic-derive.rs:438:52
|
LL | #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: previously specified here
--> $DIR/diagnostic-derive.rs:440:24
|
LL | suggestion: (Span, Applicability),
| ^^^^^^^^^^^^^
error: invalid applicability
--> $DIR/diagnostic-derive.rs:446:52