1
Fork 0

Account for macros

This commit is contained in:
Esteban Küber 2023-10-09 22:48:10 +00:00
parent c30d57bb77
commit d23dc2093c
3 changed files with 113 additions and 1 deletions

View file

@ -231,7 +231,7 @@ impl<'a, 'hir> CheckLoopVisitor<'a, 'hir> {
AsyncClosure(closure_span) => {
self.sess.emit_err(BreakInsideAsyncBlock { span, closure_span, name });
}
UnlabeledBlock(block_span) if is_break => {
UnlabeledBlock(block_span) if is_break && block_span.ctxt() == break_span.ctxt() => {
let suggestion = Some(OutsideLoopSuggestion { block_span, break_span });
self.sess.emit_err(OutsideLoop { span, name, is_break, suggestion });
}