diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-05-30 16:01:00 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-06-10 08:41:23 +0000 |
| commit | 1b9d38dd08d2e09b2ea6b18a0201252203f63e27 (patch) | |
| tree | 40c029201345dd40a2882efde54ee7da3ab70eb8 /tests/ui | |
| parent | b73bf3c0b52d3fa61f0110f3fc867ca69f9f43ae (diff) | |
| download | rust-1b9d38dd08d2e09b2ea6b18a0201252203f63e27.tar.gz rust-1b9d38dd08d2e09b2ea6b18a0201252203f63e27.zip | |
Remove check_mod_loops query and run the checks per-body instead
Diffstat (limited to 'tests/ui')
5 files changed, 45 insertions, 45 deletions
diff --git a/tests/ui/async-await/async-block-control-flow-static-semantics.stderr b/tests/ui/async-await/async-block-control-flow-static-semantics.stderr index 4ed15a942c6..b64690bae6c 100644 --- a/tests/ui/async-await/async-block-control-flow-static-semantics.stderr +++ b/tests/ui/async-await/async-block-control-flow-static-semantics.stderr @@ -1,19 +1,3 @@ -error[E0267]: `break` inside `async` block - --> $DIR/async-block-control-flow-static-semantics.rs:32:9 - | -LL | async { - | ----- enclosing `async` block -LL | break 0u8; - | ^^^^^^^^^ cannot `break` inside `async` block - -error[E0267]: `break` inside `async` block - --> $DIR/async-block-control-flow-static-semantics.rs:39:13 - | -LL | async { - | ----- enclosing `async` block -LL | break 0u8; - | ^^^^^^^^^ cannot `break` inside `async` block - error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:21:58 | @@ -50,6 +34,22 @@ LL | let _: &dyn Future<Output = ()> = █ | = note: required for the cast from `&{async block@$DIR/async-block-control-flow-static-semantics.rs:14:17: 14:22}` to `&dyn Future<Output = ()>` +error[E0267]: `break` inside `async` block + --> $DIR/async-block-control-flow-static-semantics.rs:32:9 + | +LL | async { + | ----- enclosing `async` block +LL | break 0u8; + | ^^^^^^^^^ cannot `break` inside `async` block + +error[E0267]: `break` inside `async` block + --> $DIR/async-block-control-flow-static-semantics.rs:39:13 + | +LL | async { + | ----- enclosing `async` block +LL | break 0u8; + | ^^^^^^^^^ cannot `break` inside `async` block + error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:49:44 | 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 dcd571a028b..aa101aa185c 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,18 +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:27:17 - | -LL | const FOO: () = 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:30:18 - | -LL | static BAR: () = 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 }]; @@ -46,6 +34,18 @@ LL | LL ~ break 'block; | +error[E0268]: `break` outside of a loop or labeled block + --> $DIR/break-inside-inline-const-issue-128604.rs:27:17 + | +LL | const FOO: () = 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:30:18 + | +LL | static BAR: () = break; + | ^^^^^ cannot `break` outside of a loop or labeled block + error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0268`. diff --git a/tests/ui/inline-const/cross-const-control-flow-125846.stderr b/tests/ui/inline-const/cross-const-control-flow-125846.stderr index 0a910e70d09..5ea571fe98a 100644 --- a/tests/ui/inline-const/cross-const-control-flow-125846.stderr +++ b/tests/ui/inline-const/cross-const-control-flow-125846.stderr @@ -39,6 +39,16 @@ LL | const { async {}.await } | | only allowed inside `async` functions and blocks | this is not `async` +error[E0572]: return statement outside of function body + --> $DIR/cross-const-control-flow-125846.rs:4:13 + | +LL | / fn foo() { +LL | | const { return } + | | --^^^^^^-- the return is part of this body... +LL | | +LL | | } + | |_- ...not the enclosing function body + error[E0268]: `break` outside of a loop or labeled block --> $DIR/cross-const-control-flow-125846.rs:9:19 | @@ -63,16 +73,6 @@ error[E0268]: `continue` outside of a loop LL | const { continue } | ^^^^^^^^ cannot `continue` outside of a loop -error[E0572]: return statement outside of function body - --> $DIR/cross-const-control-flow-125846.rs:4:13 - | -LL | / fn foo() { -LL | | const { return } - | | --^^^^^^-- the return is part of this body... -LL | | -LL | | } - | |_- ...not the enclosing function body - error: aborting due to 9 previous errors Some errors have detailed explanations: E0268, E0435, E0572, E0728, E0767. diff --git a/tests/ui/loops/issue-43162.stderr b/tests/ui/loops/issue-43162.stderr index 40d9200058e..f6b6bf2621c 100644 --- a/tests/ui/loops/issue-43162.stderr +++ b/tests/ui/loops/issue-43162.stderr @@ -4,12 +4,6 @@ error[E0268]: `break` outside of a loop or labeled block LL | break true; | ^^^^^^^^^^ cannot `break` outside of a loop or labeled block -error[E0268]: `break` outside of a loop or labeled block - --> $DIR/issue-43162.rs:7:5 - | -LL | break {}; - | ^^^^^^^^ cannot `break` outside of a loop or labeled block - error[E0308]: mismatched types --> $DIR/issue-43162.rs:1:13 | @@ -18,6 +12,12 @@ LL | fn foo() -> bool { | | | implicitly returns `()` as its body has no tail or `return` expression +error[E0268]: `break` outside of a loop or labeled block + --> $DIR/issue-43162.rs:7:5 + | +LL | break {}; + | ^^^^^^^^ cannot `break` outside of a loop or labeled block + error: aborting due to 3 previous errors Some errors have detailed explanations: E0268, E0308. diff --git a/tests/ui/track-diagnostics/track.stderr b/tests/ui/track-diagnostics/track.stderr index d2908bb9177..527c0d1b898 100644 --- a/tests/ui/track-diagnostics/track.stderr +++ b/tests/ui/track-diagnostics/track.stderr @@ -10,7 +10,7 @@ error[E0268]: `break` outside of a loop or labeled block | LL | break rust | ^^^^^^^^^^ cannot `break` outside of a loop or labeled block --Ztrack-diagnostics: created at compiler/rustc_passes/src/loops.rs:LL:CC +-Ztrack-diagnostics: created at compiler/rustc_hir_typeck/src/loops.rs:LL:CC error: internal compiler error: It looks like you're trying to break rust; would you like some ICE? --> $DIR/track.rs:LL:CC |
