diff options
| author | clubby789 <jamie@hill-daniel.co.uk> | 2022-11-05 01:11:50 +0000 |
|---|---|---|
| committer | clubby789 <jamie@hill-daniel.co.uk> | 2022-11-05 01:12:58 +0000 |
| commit | 2f882c014f3bfabb811177d24bfb72e3f6b6d271 (patch) | |
| tree | 8bf53e1ae1943a2c7f22c62fe72993892380f959 /compiler/rustc_passes/src/loops.rs | |
| parent | 09508489efc223287731fe8abbd2a81bbf7adf8e (diff) | |
| download | rust-2f882c014f3bfabb811177d24bfb72e3f6b6d271.tar.gz rust-2f882c014f3bfabb811177d24bfb72e3f6b6d271.zip | |
Specify that `break` cannot be used outside of loop *or* labeled block
Diffstat (limited to 'compiler/rustc_passes/src/loops.rs')
| -rw-r--r-- | compiler/rustc_passes/src/loops.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_passes/src/loops.rs b/compiler/rustc_passes/src/loops.rs index 077194ec687..b4cf19e4a34 100644 --- a/compiler/rustc_passes/src/loops.rs +++ b/compiler/rustc_passes/src/loops.rs @@ -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" }); } } } |
