For OutsideLoop we should not suggest add 'block label in if block, or we wiil get another err: block label not supported here.

fixes #123261
This commit is contained in:
surechen
2024-04-08 16:19:09 +08:00
parent 60faa271d9
commit 8fde7e3b64
6 changed files with 290 additions and 45 deletions

View File

@@ -1103,7 +1103,7 @@ pub struct BreakInsideCoroutine<'a> {
pub struct OutsideLoop<'a> {
#[primary_span]
#[label]
pub span: Span,
pub spans: Vec<Span>,
pub name: &'a str,
pub is_break: bool,
#[subdiagnostic]
@@ -1115,7 +1115,7 @@ pub struct OutsideLoopSuggestion {
#[suggestion_part(code = "'block: ")]
pub block_span: Span,
#[suggestion_part(code = " 'block")]
pub break_span: Span,
pub break_spans: Vec<Span>,
}
#[derive(Diagnostic)]