<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_mir_transform/src/inline.rs, branch perf-tmp</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-10-02T06:55:51+00:00</updated>
<entry>
<title>mir-opt: Eliminate trivial unnecessary storage annotations</title>
<updated>2025-10-02T06:55:51+00:00</updated>
<author>
<name>dianqk</name>
<email>dianqk@dianqk.net</email>
</author>
<published>2025-07-15T14:54:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=85b2f706939528b5796d98e82c183637f8338cd1'/>
<id>urn:sha1:85b2f706939528b5796d98e82c183637f8338cd1</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>Auto merge of #142890 - kornelski:unused-var-debug, r=saethlin</title>
<updated>2025-07-03T23:17:03+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-07-03T23:17:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=837c5dd7de03aa97190593aef4e70d53e1bb574b'/>
<id>urn:sha1:837c5dd7de03aa97190593aef4e70d53e1bb574b</id>
<content type='text'>
MIR inliner maintains unused var_debug_info

Only `full` debuginfo level promises variable-level debug information, but the MIR inline pass needlessly preserved the local variable debug info for the `limited` level too.
</content>
</entry>
<entry>
<title>mir: Add a `new` method to `statement`</title>
<updated>2025-06-29T12:13:36+00:00</updated>
<author>
<name>dianqk</name>
<email>dianqk@dianqk.net</email>
</author>
<published>2025-06-08T07:30:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9f9cd5e2837f57504b92b5acbadb48ff0cb9e29c'/>
<id>urn:sha1:9f9cd5e2837f57504b92b5acbadb48ff0cb9e29c</id>
<content type='text'>
Avoid introducing a large number of changes when adding optional initialization fields.
</content>
</entry>
<entry>
<title>Keep inlined var_debug_info only when full debug info is used</title>
<updated>2025-06-28T11:22:49+00:00</updated>
<author>
<name>Kornel</name>
<email>kornel@geekhood.net</email>
</author>
<published>2025-02-08T01:33:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c9ef11695ffee0dc17f795b51c19f333abdb08a2'/>
<id>urn:sha1:c9ef11695ffee0dc17f795b51c19f333abdb08a2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Only store the LocalDefId instead of the whole instance.</title>
<updated>2025-06-23T08:44:31+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2025-06-19T08:47:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2074013f44e4b12a0949182d050d3470bd76e4de'/>
<id>urn:sha1:2074013f44e4b12a0949182d050d3470bd76e4de</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Only compute recursive callees once.</title>
<updated>2025-06-22T20:08:49+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2025-06-17T13:24:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=09aab29ebf93fbb546d409d1e127392abf36cd8a'/>
<id>urn:sha1:09aab29ebf93fbb546d409d1e127392abf36cd8a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>don't depend on rustc_attr_parsing if rustc_data_structures will do</title>
<updated>2025-05-09T21:16:55+00:00</updated>
<author>
<name>mejrs</name>
<email>59372212+mejrs@users.noreply.github.com</email>
</author>
<published>2025-05-09T21:16:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=684b7b70f4940a0abfecd3d95fe339960d6048d4'/>
<id>urn:sha1:684b7b70f4940a0abfecd3d95fe339960d6048d4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added.</title>
<updated>2025-04-28T09:23:13+00:00</updated>
<author>
<name>Andrew Zhogin</name>
<email>andrew.zhogin@gmail.com</email>
</author>
<published>2024-08-26T13:45:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c366756a8537ef998d32c1ef57098d5aae7ca92f'/>
<id>urn:sha1:c366756a8537ef998d32c1ef57098d5aae7ca92f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #139042 - compiler-errors:do-not-optimize-switchint, r=saethlin</title>
<updated>2025-04-19T19:30:46+00:00</updated>
<author>
<name>Chris Denton</name>
<email>chris@chrisdenton.dev</email>
</author>
<published>2025-04-19T19:30:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5d2375f789e88d0ac6dbbd828082559a5d2fa8c6'/>
<id>urn:sha1:5d2375f789e88d0ac6dbbd828082559a5d2fa8c6</id>
<content type='text'>
Do not remove trivial `SwitchInt` in analysis MIR

This PR ensures that we don't prematurely remove trivial `SwitchInt` terminators which affects both the borrow-checking and runtime semantics (i.e. UB) of the code. Previously the `SimplifyCfg` optimization was removing `SwitchInt` terminators when they was "trivial", i.e. when all arms branched to the same basic block, even if that `SwitchInt` terminator had the side-effect of reading an operand which (for example) may not be initialized or may point to an invalid place in memory.

This behavior is unlike all other optimizations, which are only applied after "analysis" (i.e. borrow-checking) is finished, and which Miri disables to make sure the compiler doesn't silently remove UB.

Fixing this code "breaks" (i.e. unmasks) code that used to borrow-check but no longer does, like:

```rust
fn foo() {
    let x;
    let (0 | _) = x;
}
```

This match expression should perform a read because `_` does not shadow the `0` literal pattern, and the compiler should have to read the match scrutinee to compare it to 0. I've checked that this behavior does not actually manifest in practice via a crater run which came back clean: https://github.com/rust-lang/rust/pull/139042#issuecomment-2767436367

As a side-note, it may be tempting to suggest that this is actually a good thing or that we should preserve this behavior. If we wanted to make this work (i.e. trivially optimize out reads from matches that are redundant like `0 | _`), then we should be enabling this behavior *after* fixing this. However, I think it's kinda unprincipled, and for example other variations of the code don't even work today, e.g.:

```rust
fn foo() {
    let x;
    let (0.. | _) = x;
}
```
</content>
</entry>
</feed>
