This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 5fb7210
authored
Rollup merge of rust-lang#72581 - samrat:allow-desugared-break-in-labeled-block, r=davidtwco
Allow unlabeled breaks from desugared `?` in labeled blocks
`?` is desugared into a `break` targeting the innermost `try` scope in which it resides. The `break` however will not have a label. https://github.com/rust-lang/rust/blob/master/src/librustc_ast_lowering/expr.rs#L1560
Since the `target` of the `break` is known, the compiler should not complain about an unlabeled jump for `break`s desugared from `?`.
Closes rust-lang#72483File tree
2 files changed
+14
-1
lines changed- src
- librustc_passes
- test/ui/label
2 files changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
206 | | - | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments