Account for macros
This commit is contained in:
parent
c30d57bb77
commit
d23dc2093c
3 changed files with 113 additions and 1 deletions
|
@ -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 });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue