Specify that break
cannot be used outside of loop *or* labeled block
This commit is contained in:
parent
09508489ef
commit
2f882c014f
14 changed files with 37 additions and 30 deletions
|
@ -193,7 +193,7 @@ impl<'a, 'hir> CheckLoopVisitor<'a, 'hir> {
|
|||
self.sess.emit_err(BreakInsideAsyncBlock { span, closure_span, name });
|
||||
}
|
||||
Normal | AnonConst => {
|
||||
self.sess.emit_err(OutsideLoop { span, name });
|
||||
self.sess.emit_err(OutsideLoop { span, name, is_break: name == "break" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue