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 /src/test/ui/for-loop-while | |
| 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 'src/test/ui/for-loop-while')
| -rw-r--r-- | src/test/ui/for-loop-while/break-outside-loop.stderr | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/ui/for-loop-while/break-outside-loop.stderr b/src/test/ui/for-loop-while/break-outside-loop.stderr index 287bf9af62e..9092f34df35 100644 --- a/src/test/ui/for-loop-while/break-outside-loop.stderr +++ b/src/test/ui/for-loop-while/break-outside-loop.stderr @@ -9,11 +9,11 @@ LL | break 'lab; | = note: labels are unreachable through functions, closures, async blocks and modules -error[E0268]: `break` outside of a loop +error[E0268]: `break` outside of a loop or labeled block --> $DIR/break-outside-loop.rs:10:15 | LL | let pth = break; - | ^^^^^ cannot `break` outside of a loop + | ^^^^^ cannot `break` outside of a loop or labeled block error[E0268]: `continue` outside of a loop --> $DIR/break-outside-loop.rs:11:17 @@ -38,11 +38,11 @@ LL | if cond() { break } LL | if cond() { continue } | ^^^^^^^^ cannot `continue` inside of a closure -error[E0268]: `break` outside of a loop +error[E0268]: `break` outside of a loop or labeled block --> $DIR/break-outside-loop.rs:24:25 | LL | let unconstrained = break; - | ^^^^^ cannot `break` outside of a loop + | ^^^^^ cannot `break` outside of a loop or labeled block error[E0267]: `break` inside of a closure --> $DIR/break-outside-loop.rs:30:13 |
