use subdiagnostic for logical negation, bitwise not
This commit is contained in:
parent
f43562b95b
commit
484b612909
3 changed files with 40 additions and 12 deletions
|
@ -430,9 +430,32 @@ pub(crate) struct NotAsNegationOperator {
|
|||
#[primary_span]
|
||||
pub negated: Span,
|
||||
pub negated_desc: String,
|
||||
pub negated_msg: String,
|
||||
#[suggestion_short(applicability = "machine-applicable", code = "!")]
|
||||
pub not: Span,
|
||||
#[subdiagnostic]
|
||||
pub sub: NotAsNegationOperatorSub,
|
||||
}
|
||||
|
||||
#[derive(SessionSubdiagnostic)]
|
||||
pub enum NotAsNegationOperatorSub {
|
||||
#[suggestion_short(
|
||||
parser::unexpected_token_after_not_default,
|
||||
applicability = "machine-applicable",
|
||||
code = "!"
|
||||
)]
|
||||
SuggestNotDefault(#[primary_span] Span),
|
||||
|
||||
#[suggestion_short(
|
||||
parser::unexpected_token_after_not_bitwise,
|
||||
applicability = "machine-applicable",
|
||||
code = "!"
|
||||
)]
|
||||
SuggestNotBitwise(#[primary_span] Span),
|
||||
|
||||
#[suggestion_short(
|
||||
parser::unexpected_token_after_not_logical,
|
||||
applicability = "machine-applicable",
|
||||
code = "!"
|
||||
)]
|
||||
SuggestNotLogical(#[primary_span] Span),
|
||||
}
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue