Auto merge of #114028 - Centri3:ternary-operator, r=compiler-errors
Gracefully handle ternary operator Fixes #112578 ~~May not be the best way to do this as it doesn't check for a single `:`, so it could perhaps appear even when the actual issue is just a missing semicolon. May not be the biggest deal, though?~~ Nevermind, got it working properly now ^^
This commit is contained in:
commit
a04e649c09
5 changed files with 241 additions and 2 deletions
|
@ -365,6 +365,14 @@ pub(crate) enum IfExpressionMissingThenBlockSub {
|
|||
AddThenBlock(#[primary_span] Span),
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(parse_ternary_operator)]
|
||||
#[help]
|
||||
pub struct TernaryOperator {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[suggestion(parse_extra_if_in_let_else, applicability = "maybe-incorrect", code = "")]
|
||||
pub(crate) struct IfExpressionLetSomeSub {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue