Rollup merge of #123623 - surechen:fix_123261, r=estebank
Fix OutsideLoop's error suggestion: adding label `'block` for `if` block. 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:
@@ -1100,7 +1100,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]
|
||||
@@ -1112,7 +1112,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)]
|
||||
|
||||
Reference in New Issue
Block a user