Uh oh!
There was an error while loading. Please reload this page.
loop match: error on #[const_continue] outside #[loop_match] - #143360
Conversation
rustbot
commented
Jul 3, 2025
rustbot has assigned @WaffleLapkin. Use |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| #[const_continue] | ||
| break State::A; | ||
| //~^ ERROR unlabeled `break` inside of a labeled block | ||
| //~| ERROR mismatched types |
There was a problem hiding this comment.
Where is mismatched types coming from?..
There was a problem hiding this comment.
the break is seen as a break from the loop with a value, and it's the final expression, so that value is returned, but the function's type says it'll return unit.
There was a problem hiding this comment.
can you fix the error so that the only errors here are the interesting ones? (e.g. by doing _ = loop {...};) or do you think this test is better with the type error?
771373e to
7d0caefCompare
folkertdev
left a comment
There was a problem hiding this comment.
Turns out there was a better way to do this at a much earlier stage. The logic now also properly handles shadowing labels (where the outer one is part of a loop_match but the inner one is not).
@rustbot ready
folkertdev
commented
Jul 22, 2025
@WaffleLapkin is anything else needed here? |
WaffleLapkin
left a comment
There was a problem hiding this comment.
Sorry for making you wait so long, I was on vacation ^^'
This looks mostly good, just a few nitpicks.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| #[const_continue] | ||
| break State::A; | ||
| //~^ ERROR unlabeled `break` inside of a labeled block | ||
| //~| ERROR mismatched types |
There was a problem hiding this comment.
can you fix the error so that the only errors here are the interesting ones? (e.g. by doing _ = loop {...};) or do you think this test is better with the type error?
7d0caef to
3686dccCompare
This comment was marked as outdated.
This comment was marked as outdated.
3686dcc to
7a2ab95Comparefolkertdev
commented
Jul 25, 2025
@rustbot ready |
WaffleLapkin
commented
Jul 31, 2025
@bors r+ rollup |
bors
commented
Jul 31, 2025
bors
commented
Jul 31, 2025
☔ The latest upstream changes (presumably #144740) made this pull request unmergeable. Please resolve the merge conflicts. |
7a2ab95 to
040f71eComparefolkertdev
commented
Aug 1, 2025
@bors r=WaffleLapkin |
bors
commented
Aug 1, 2025
…loop-match, r=WaffleLapkin loop match: error on `#[const_continue]` outside `#[loop_match]` tracking issue rust-lang#132306fixesrust-lang#143119fixesrust-lang#143165 Fixes several ICEs because a panic was reachable. `@rustbot` label +F-loop_match
Rollup of 10 pull requests Successful merges: - #132748 (get rid of some false negatives in rustdoc::broken_intra_doc_links) - #135771 ([rustdoc] Add support for associated items in "jump to def" feature) - #143360 (loop match: error on `#[const_continue]` outside `#[loop_match]`) - #143662 ([rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.) - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition) - #144614 (Fortify RemoveUnneededDrops test.) - #144703 ([test][AIX] ignore extern_weak linkage test) - #144738 (Remove the omit_gdb_pretty_printer_section attribute) - #144756 (detect infinite recursion with tail calls in ctfe) - #144766 (Add human readable name "Cygwin") r? `@ghost` `@rustbot` modify labels: rollup
…loop-match, r=WaffleLapkin loop match: error on `#[const_continue]` outside `#[loop_match]` tracking issue rust-lang#132306fixesrust-lang#143119fixesrust-lang#143165 Fixes several ICEs because a panic was reachable. ``@rustbot`` label +F-loop_match
Rollup of 11 pull requests Successful merges: - #132748 (get rid of some false negatives in rustdoc::broken_intra_doc_links) - #135771 ([rustdoc] Add support for associated items in "jump to def" feature) - #143360 (loop match: error on `#[const_continue]` outside `#[loop_match]`) - #143662 ([rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.) - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition) - #144478 (Improve formatting of doc code blocks) - #144703 ([test][AIX] ignore extern_weak linkage test) - #144747 (compiletest: Improve diagnostics for line annotation mismatches 2) - #144756 (detect infinite recursion with tail calls in ctfe) - #144766 (Add human readable name "Cygwin") - #144782 (Properly pass path to staged `rustc` to `compiletest` self-tests) r? `@ghost` `@rustbot` modify labels: rollup
…loop-match, r=WaffleLapkin loop match: error on `#[const_continue]` outside `#[loop_match]` tracking issue rust-lang#132306fixesrust-lang#143119fixesrust-lang#143165 Fixes several ICEs because a panic was reachable. ```@rustbot``` label +F-loop_match
…loop-match, r=WaffleLapkin loop match: error on `#[const_continue]` outside `#[loop_match]` tracking issue rust-lang#132306fixesrust-lang#143119fixesrust-lang#143165 Fixes several ICEs because a panic was reachable. ````@rustbot```` label +F-loop_match
Rollup of 12 pull requests Successful merges: - #132748 (get rid of some false negatives in rustdoc::broken_intra_doc_links) - #135771 ([rustdoc] Add support for associated items in "jump to def" feature) - #143360 (loop match: error on `#[const_continue]` outside `#[loop_match]`) - #143662 ([rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.) - #144478 (Improve formatting of doc code blocks) - #144703 ([test][AIX] ignore extern_weak linkage test) - #144747 (compiletest: Improve diagnostics for line annotation mismatches 2) - #144766 (Add human readable name "Cygwin") - #144782 (Properly pass path to staged `rustc` to `compiletest` self-tests) - #144786 (Cleanup the definition of `group_type`) - #144796 (Add my previous commit name to .mailmap) - #144797 (Update safety comment for new_unchecked in niche_types) r? `@ghost` `@rustbot` modify labels: rollup
…loop-match, r=WaffleLapkin loop match: error on `#[const_continue]` outside `#[loop_match]` tracking issue rust-lang#132306fixesrust-lang#143119fixesrust-lang#143165 Fixes several ICEs because a panic was reachable. `````@rustbot````` label +F-loop_match
Rollup of 18 pull requests Successful merges: - #132748 (get rid of some false negatives in rustdoc::broken_intra_doc_links) - #135771 ([rustdoc] Add support for associated items in "jump to def" feature) - #143360 (loop match: error on `#[const_continue]` outside `#[loop_match]`) - #143662 ([rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.) - #143771 (Constify some more `Result` functions) - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition) - #144185 (Document guarantees of poisoning) - #144395 (update fortanix tests) - #144478 (Improve formatting of doc code blocks) - #144614 (Fortify RemoveUnneededDrops test.) - #144703 ([test][AIX] ignore extern_weak linkage test) - #144747 (compiletest: Improve diagnostics for line annotation mismatches 2) - #144756 (detect infinite recursion with tail calls in ctfe) - #144766 (Add human readable name "Cygwin") - #144782 (Properly pass path to staged `rustc` to `compiletest` self-tests) - #144786 (Cleanup the definition of `group_type`) - #144796 (Add my previous commit name to .mailmap) - #144797 (Update safety comment for new_unchecked in niche_types) Failed merges: - #144805 (compiletest: Preliminary cleanup of `ProcRes` printing/unwinding) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 17 pull requests Successful merges: - #132748 (get rid of some false negatives in rustdoc::broken_intra_doc_links) - #143360 (loop match: error on `#[const_continue]` outside `#[loop_match]`) - #143662 ([rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.) - #143771 (Constify some more `Result` functions) - #144185 (Document guarantees of poisoning) - #144395 (update fortanix tests) - #144478 (Improve formatting of doc code blocks) - #144614 (Fortify RemoveUnneededDrops test.) - #144703 ([test][AIX] ignore extern_weak linkage test) - #144747 (compiletest: Improve diagnostics for line annotation mismatches 2) - #144756 (detect infinite recursion with tail calls in ctfe) - #144766 (Add human readable name "Cygwin") - #144782 (Properly pass path to staged `rustc` to `compiletest` self-tests) - #144786 (Cleanup the definition of `group_type`) - #144796 (Add my previous commit name to .mailmap) - #144797 (Update safety comment for new_unchecked in niche_types) - #144803 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Uh oh!
There was an error while loading. Please reload this page.
Rollup of 17 pull requests Successful merges: - rust-lang/rust#132748 (get rid of some false negatives in rustdoc::broken_intra_doc_links) - rust-lang/rust#143360 (loop match: error on `#[const_continue]` outside `#[loop_match]`) - rust-lang/rust#143662 ([rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.) - rust-lang/rust#143771 (Constify some more `Result` functions) - rust-lang/rust#144185 (Document guarantees of poisoning) - rust-lang/rust#144395 (update fortanix tests) - rust-lang/rust#144478 (Improve formatting of doc code blocks) - rust-lang/rust#144614 (Fortify RemoveUnneededDrops test.) - rust-lang/rust#144703 ([test][AIX] ignore extern_weak linkage test) - rust-lang/rust#144747 (compiletest: Improve diagnostics for line annotation mismatches 2) - rust-lang/rust#144756 (detect infinite recursion with tail calls in ctfe) - rust-lang/rust#144766 (Add human readable name "Cygwin") - rust-lang/rust#144782 (Properly pass path to staged `rustc` to `compiletest` self-tests) - rust-lang/rust#144786 (Cleanup the definition of `group_type`) - rust-lang/rust#144796 (Add my previous commit name to .mailmap) - rust-lang/rust#144797 (Update safety comment for new_unchecked in niche_types) - rust-lang/rust#144803 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
tracking issue #132306
fixes#143119
fixes#143165
Fixes several ICEs because a panic was reachable.
@rustbot label +F-loop_match