<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_mir_build/src/thir/cx/expr.rs, branch auto</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=auto</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=auto'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-09-09T12:49:16+00:00</updated>
<entry>
<title>erase_regions to erase_and_anonymize_regions</title>
<updated>2025-09-09T12:49:16+00:00</updated>
<author>
<name>Boxy</name>
<email>rust@boxyuwu.dev</email>
</author>
<published>2025-08-21T15:50:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e379c7758667f900aaf5551c4553c7d4c121e3e1'/>
<id>urn:sha1:e379c7758667f900aaf5551c4553c7d4c121e3e1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>loop match: error on `#[const_continue]` outside `#[loop_match]`</title>
<updated>2025-07-31T22:28:52+00:00</updated>
<author>
<name>Folkert de Vries</name>
<email>folkert@folkertdev.nl</email>
</author>
<published>2025-07-25T13:18:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=040f71e8123b5994177f787e64aecd9b06cdfa7e'/>
<id>urn:sha1:040f71e8123b5994177f787e64aecd9b06cdfa7e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove rustc_attr_data_structures</title>
<updated>2025-07-31T12:19:27+00:00</updated>
<author>
<name>Jana Dönszelmann</name>
<email>jana@donsz.nl</email>
</author>
<published>2025-07-31T09:00:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e1d3ad89c7a2ad4f5d944a7fee1298ffe8c99645'/>
<id>urn:sha1:e1d3ad89c7a2ad4f5d944a7fee1298ffe8c99645</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: Reject upvar scrutinees for `loop_match`</title>
<updated>2025-07-28T13:24:58+00:00</updated>
<author>
<name>Shoyu Vanilla</name>
<email>modulo641@gmail.com</email>
</author>
<published>2025-07-25T14:07:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d87b4f2c77add3404f7469ea72f1d7c51e2a29dc'/>
<id>urn:sha1:d87b4f2c77add3404f7469ea72f1d7c51e2a29dc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>use let chains in hir, lint, mir</title>
<updated>2025-07-28T01:10:14+00:00</updated>
<author>
<name>Kivooeo</name>
<email>Kivooeo123@gmail.com</email>
</author>
<published>2025-07-26T01:21:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bae38bad7803be7fdf1878188da9650f82548016'/>
<id>urn:sha1:bae38bad7803be7fdf1878188da9650f82548016</id>
<content type='text'>
</content>
</entry>
<entry>
<title>loop match: run exhaustiveness check</title>
<updated>2025-07-01T13:53:50+00:00</updated>
<author>
<name>Folkert de Vries</name>
<email>folkert@folkertdev.nl</email>
</author>
<published>2025-07-01T13:29:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=aa7cc5d2f453853a4025cf029f3e42625c7e1e18'/>
<id>urn:sha1:aa7cc5d2f453853a4025cf029f3e42625c7e1e18</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #138780 - trifectatechfoundation:loop_match_attr, r=oli-obk,traviscross</title>
<updated>2025-06-25T02:45:30+00:00</updated>
<author>
<name>Jubilee</name>
<email>workingjubilee@gmail.com</email>
</author>
<published>2025-06-25T02:45:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f542909d1ceae371fe0e236e00276109522fa86d'/>
<id>urn:sha1:f542909d1ceae371fe0e236e00276109522fa86d</id>
<content type='text'>
Add `#[loop_match]` for improved DFA codegen

tracking issue: https://github.com/rust-lang/rust/issues/132306
project goal: https://github.com/rust-lang/rust-project-goals/issues/258

This PR adds the `#[loop_match]` attribute, which aims to improve code generation for state machines. For some (very exciting) benchmarks, see https://github.com/rust-lang/rust-project-goals/issues/258#issuecomment-2732965199

Currently, a very restricted syntax pattern is accepted. We'd like to get feedback and merge this now before we go too far in a direction that others have concerns with.

## current state

We accept code that looks like this

```rust
#[loop_match]
loop {
    state = 'blk: {
        match state {
            State::A =&gt; {
                #[const_continue]
                break 'blk State::B
            }
            State::B =&gt; { /* ... */ }
            /* ... */
        }
    }
}
```

- a loop should have the same semantics with and without `#[loop_match]`: normal `continue` and `break` continue to work
- `#[const_continue]` is only allowed in loops annotated with `#[loop_match]`
- the loop body needs to have this particular shape (a single assignment to the match scrutinee, with the body a labelled block containing just a match)

## future work

- perform const evaluation on the `break` value
- support more state/scrutinee types

## maybe future work

- allow `continue 'label value` syntax, which `#[const_continue]` could then use.
- allow the match to be on an arbitrary expression (e.g. `State::Initial`)
- attempt to also optimize `break`/`continue` expressions that are not marked with `#[const_continue]`

r? ``@traviscross``
</content>
</entry>
<entry>
<title>Add `#[loop_match]` for improved DFA codegen</title>
<updated>2025-06-23T18:43:04+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2025-02-18T13:16:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ba5556d239c11232dc8d95123ea70a2783019476'/>
<id>urn:sha1:ba5556d239c11232dc8d95123ea70a2783019476</id>
<content type='text'>
Co-authored-by: Folkert de Vries &lt;folkert@folkertdev.nl&gt;
</content>
</entry>
<entry>
<title>Move the place in `&amp;pin mut $place` when `!Unpin` to ensure soundness</title>
<updated>2025-06-15T02:31:11+00:00</updated>
<author>
<name>Frank King</name>
<email>frankking1729@gmail.com</email>
</author>
<published>2025-04-04T04:15:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=afdb54a673243c83660417b540af888f7690f0fb'/>
<id>urn:sha1:afdb54a673243c83660417b540af888f7690f0fb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Implement pinned borrows, part of `pin_ergonomics`</title>
<updated>2025-06-15T02:21:29+00:00</updated>
<author>
<name>Frank King</name>
<email>frankking1729@gmail.com</email>
</author>
<published>2025-01-19T14:01:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e627f88f88de85cc52ff1c99a076909084806c98'/>
<id>urn:sha1:e627f88f88de85cc52ff1c99a076909084806c98</id>
<content type='text'>
</content>
</entry>
</feed>
