1
Fork 0
rust/tests
Matthias Krüger c3f74bcb39
Rollup merge of #138589 - zachs18:block-label-not-supported-here-loop-body-help, r=petrochenkov
If a label is placed on the block of a loop instead of the header, suggest moving it to the header.

Fixes #138585

If a label is placed on the block of a loop instead of the header, suggest to the user moving it to the loop header instead of ~~suggesting to remove it~~ emitting a tool-only suggestion to remove it.

```rs
fn main() {
    loop 'a: { return; }
}
```

```diff
 error: block label not supported here
  --> src/main.rs:2:10
   |
 2 |     loop 'a: { return; }
   |          ^^^ not supported here
+  |
+help: if you meant to label the loop, move this label before the loop
+  |
+2 -     loop 'a: { return; }
+2 +     'a: loop { return; }
+  |
```

Questions for reviewer:

* The "desired output" in the linked issue had the main diagnostic be "misplaced loop label". Should the main diagnostic message the changed instead of leaving it as "block label not supported here"?
* Should this be `Applicability::MachineApplicable`?
2025-03-19 16:52:56 +01:00
..
assembly Rollup merge of #137816 - folkertdev:naked-asm-xcoff, r=Noratrieb 2025-03-13 11:28:20 +01:00
auxiliary tests: use minicore more 2025-02-24 09:26:54 +00:00
codegen Auto merge of #127173 - bjorn3:mangle_rustc_std_internal_symbol, r=wesleywiser,jieyouxu 2025-03-17 22:16:22 +00:00
codegen-units
coverage
coverage-run-rustdoc
crashes Remove existing AFIDT implementation 2025-03-18 17:35:26 +00:00
debuginfo Rollup merge of #137967 - mustartt:fix-aix-test-hangs, r=workingjubilee 2025-03-11 13:30:50 +01:00
incremental remove most simd_ intrinsic declaration in tests 2025-02-27 12:22:59 +01:00
mir-opt coverage: Don't store a body span in FunctionCoverageInfo 2025-03-18 23:18:24 +11:00
pretty Fix HIR param pretty printing some more. 2025-03-14 09:45:41 +11:00
run-make Auto merge of #127173 - bjorn3:mangle_rustc_std_internal_symbol, r=wesleywiser,jieyouxu 2025-03-17 22:16:22 +00:00
rustdoc Add RTN support to rustdoc 2025-03-15 18:13:27 +00:00
rustdoc-gui Rollup merge of #137539 - GuillaumeGomez:copy-content-tests, r=notriddle 2025-02-25 13:07:34 +01:00
rustdoc-js
rustdoc-js-std
rustdoc-json Rollup merge of #138569 - aDotInTheVoid:reprdoc-json, r=GuillaumeGomez 2025-03-18 10:09:30 +01:00
rustdoc-ui Fix ICE: attempted to remap an already remapped filename 2025-03-16 23:37:09 +01:00
ui Rollup merge of #138589 - zachs18:block-label-not-supported-here-loop-body-help, r=petrochenkov 2025-03-19 16:52:56 +01:00
ui-fulldeps Make opts.maybe_sysroot non-optional 2025-03-12 15:05:24 +00:00
COMPILER_TESTS.md