diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-06-02 07:53:07 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-06-10 08:41:23 +0000 |
| commit | 7f4093e78bbddae798e3eaf4d713da75c6315877 (patch) | |
| tree | 25cbaf81aacbda718f2f13680367aadfcad0e757 /tests/ui | |
| parent | 1b9d38dd08d2e09b2ea6b18a0201252203f63e27 (diff) | |
| download | rust-7f4093e78bbddae798e3eaf4d713da75c6315877.tar.gz rust-7f4093e78bbddae798e3eaf4d713da75c6315877.zip | |
Loop check anon consts on their own
Diffstat (limited to 'tests/ui')
3 files changed, 35 insertions, 35 deletions
diff --git a/tests/ui/inline-const/break-inside-inline-const-issue-128604.stderr b/tests/ui/inline-const/break-inside-inline-const-issue-128604.stderr index aa101aa185c..6a967c59864 100644 --- a/tests/ui/inline-const/break-inside-inline-const-issue-128604.stderr +++ b/tests/ui/inline-const/break-inside-inline-const-issue-128604.stderr @@ -11,17 +11,6 @@ LL | break; | ^^^^^ cannot `break` outside of a loop or labeled block error[E0268]: `break` outside of a loop or labeled block - --> $DIR/break-inside-inline-const-issue-128604.rs:2:21 - | -LL | let _ = ['a'; { break 2; 1 }]; - | ^^^^^^^ cannot `break` outside of a loop or labeled block - | -help: consider labeling this block to be able to break within it - | -LL | let _ = ['a'; 'block: { break 'block 2; 1 }]; - | +++++++ ++++++ - -error[E0268]: `break` outside of a loop or labeled block --> $DIR/break-inside-inline-const-issue-128604.rs:9:13 | LL | break; @@ -35,6 +24,17 @@ LL ~ break 'block; | error[E0268]: `break` outside of a loop or labeled block + --> $DIR/break-inside-inline-const-issue-128604.rs:2:21 + | +LL | let _ = ['a'; { break 2; 1 }]; + | ^^^^^^^ cannot `break` outside of a loop or labeled block + | +help: consider labeling this block to be able to break within it + | +LL | let _ = ['a'; 'block: { break 'block 2; 1 }]; + | +++++++ ++++++ + +error[E0268]: `break` outside of a loop or labeled block --> $DIR/break-inside-inline-const-issue-128604.rs:27:17 | LL | const FOO: () = break; diff --git a/tests/ui/typeck/issue-114529-illegal-break-with-value.stderr b/tests/ui/typeck/issue-114529-illegal-break-with-value.stderr index de993df722c..872c506c7f1 100644 --- a/tests/ui/typeck/issue-114529-illegal-break-with-value.stderr +++ b/tests/ui/typeck/issue-114529-illegal-break-with-value.stderr @@ -1,4 +1,22 @@ error[E0571]: `break` with value from a `while` loop + --> $DIR/issue-114529-illegal-break-with-value.rs:22:9 + | +LL | while true { + | ---------- you can't `break` with a value in a `while` loop +LL | / break (|| { +LL | | let local = 9; +LL | | }); + | |__________^ can only break with a value inside `loop` or breakable block + | +help: use `break` on its own without a value inside this `while` loop + | +LL - break (|| { +LL - let local = 9; +LL - }); +LL + break; + | + +error[E0571]: `break` with value from a `while` loop --> $DIR/issue-114529-illegal-break-with-value.rs:9:13 | LL | while true { @@ -26,24 +44,6 @@ LL - break v; LL + break; | -error[E0571]: `break` with value from a `while` loop - --> $DIR/issue-114529-illegal-break-with-value.rs:22:9 - | -LL | while true { - | ---------- you can't `break` with a value in a `while` loop -LL | / break (|| { -LL | | let local = 9; -LL | | }); - | |__________^ can only break with a value inside `loop` or breakable block - | -help: use `break` on its own without a value inside this `while` loop - | -LL - break (|| { -LL - let local = 9; -LL - }); -LL + break; - | - error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0571`. diff --git a/tests/ui/unsafe/break-inside-unsafe-block-issue-128604.stderr b/tests/ui/unsafe/break-inside-unsafe-block-issue-128604.stderr index b7cbe1a5cf4..2f01331db9a 100644 --- a/tests/ui/unsafe/break-inside-unsafe-block-issue-128604.stderr +++ b/tests/ui/unsafe/break-inside-unsafe-block-issue-128604.stderr @@ -1,10 +1,4 @@ error[E0268]: `break` outside of a loop or labeled block - --> $DIR/break-inside-unsafe-block-issue-128604.rs:2:28 - | -LL | let a = ["_"; unsafe { break; 1 + 2 }]; - | ^^^^^ cannot `break` outside of a loop or labeled block - -error[E0268]: `break` outside of a loop or labeled block --> $DIR/break-inside-unsafe-block-issue-128604.rs:14:9 | LL | break; @@ -37,6 +31,12 @@ LL | unsafe { LL ~ break 'block; | +error[E0268]: `break` outside of a loop or labeled block + --> $DIR/break-inside-unsafe-block-issue-128604.rs:2:28 + | +LL | let a = ["_"; unsafe { break; 1 + 2 }]; + | ^^^^^ cannot `break` outside of a loop or labeled block + error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0268`. |
