Account for macros
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user