<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_mir_transform/src/pass_manager.rs, branch automation/bors/try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=automation/bors/try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=automation/bors/try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-31T23:19:03+00:00</updated>
<entry>
<title>Introduce `MirDumper` and `MirWriter`.</title>
<updated>2025-08-31T23:19:03+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-08-15T04:38:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5ce3797073ee5e6cc487b80effbc682533d9425c'/>
<id>urn:sha1:5ce3797073ee5e6cc487b80effbc682533d9425c</id>
<content type='text'>
MIR dumping is a mess. There are lots of functions and entry points,
e.g. `dump_mir`, `dump_mir_with_options`, `dump_polonius_mir`,
`dump_mir_to_writer`. Also, it's crucial that `create_dump_file` is
never called without `dump_enabled` first being checked, but there is no
mechanism for ensuring this and it's hard to tell if it is satisfied on
all paths. (`dump_enabled` is checked twice on some paths, however!)

This commit introduces `MirWriter`, which controls the MIR writing, and
encapsulates the `extra_data` closure and `options`. Two existing
functions are now methods of this type. It sets reasonable defaults,
allowing the removal of many `|_, _| Ok(())` closures.

The commit also introduces `MirDumper`, which is layered on top of
`MirWriter`, and which manages the creation of the dump files,
encapsulating pass names, disambiguators, etc. Four existing functions
are now methods of this type.
- `MirDumper::new` will only succeed if dumps are enabled, and will
  return `None` otherwise, which makes it impossible to dump when you
  shouldn't.
- It also sets reasonable defaults for various things like
  disambiguators, which means you no longer need to specify them in many
  cases. When they do need to be specified, it's now done via setter
  methods.
- It avoids some repetition. E.g. `dump_nll_mir` previously specifed the
  pass name `"nll"` four times and the disambiguator `&amp;0` three times;
  now it specifies them just once, to put them in the `MirDumper`.
- For Polonius, the `extra_data` closure can now be specified earlier,
  which avoids having to pass some arguments through some functions.
</content>
</entry>
<entry>
<title>Use trait object references for closures.</title>
<updated>2025-08-31T22:52:34+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-08-15T03:13:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d3e2c93498d2ed4b924ac7b1d42bd824d58ffe0e'/>
<id>urn:sha1:d3e2c93498d2ed4b924ac7b1d42bd824d58ffe0e</id>
<content type='text'>
The dynamic dispatch cost doesn't matter for MIR dumping, which is
perf-insensitive. And it's necessary for the next commit, which will
store some `extra_data` closures in a struct.
</content>
</entry>
<entry>
<title>Inline and remove `dump_mir_for_pass`.</title>
<updated>2025-08-31T22:52:33+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-08-14T01:13:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3a0d0be586c0135bff8e8e2a280ee647337a07e7'/>
<id>urn:sha1:3a0d0be586c0135bff8e8e2a280ee647337a07e7</id>
<content type='text'>
The code is more readable without it.
</content>
</entry>
<entry>
<title>Print regions in `type_name`.</title>
<updated>2025-08-14T11:13:06+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-08-07T18:56:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8296ad04568597fbfab4460530032cd54f5cd26b'/>
<id>urn:sha1:8296ad04568597fbfab4460530032cd54f5cd26b</id>
<content type='text'>
Currently they are skipped, which is a bit weird, and it sometimes
causes malformed output like `Foo&lt;&gt;` and `dyn Bar&lt;, A = u32&gt;`.

Most regions are erased by the time `type_name` does its work. So all
regions are now printed as `'_` in non-optional places. Not perfect, but
better than the status quo.

`c_name` is updated to trim lifetimes from MIR pass names, so that the
`PASS_NAMES` sanity check still works. It is also renamed as
`simplify_pass_type_name` and made non-const, because it doesn't need
to be const and the non-const implementation is much shorter.

The commit also renames `should_print_region` as
`should_print_optional_region`, which makes it clearer that it only
applies to some regions.

Fixes #145168.
</content>
</entry>
<entry>
<title>Disable non-required MIR opts with `optimize(none)`</title>
<updated>2025-01-23T17:40:41+00:00</updated>
<author>
<name>clubby789</name>
<email>jamie@hill-daniel.co.uk</email>
</author>
<published>2024-12-09T19:34:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7a9661d768f52d4bde71b6f2ed605f33c7053d78'/>
<id>urn:sha1:7a9661d768f52d4bde71b6f2ed605f33c7053d78</id>
<content type='text'>
Co-authored-by: Waffle Lapkin &lt;waffle.lapkin@gmail.com&gt;
</content>
</entry>
<entry>
<title>mir_transform: implement forced inlining</title>
<updated>2025-01-10T18:37:54+00:00</updated>
<author>
<name>David Wood</name>
<email>david.wood2@arm.com</email>
</author>
<published>2024-09-23T17:46:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f86169a58f212b174a01aa721545df009e96bfda'/>
<id>urn:sha1:f86169a58f212b174a01aa721545df009e96bfda</id>
<content type='text'>
Adds `#[rustc_force_inline]` which is similar to always inlining but
reports an error if the inlining was not possible, and which always
attempts to inline annotated items, regardless of optimisation levels.
It can only be applied to free functions to guarantee that the MIR
inliner will be able to resolve calls.
</content>
</entry>
<entry>
<title>mir validator: don't store mir phase</title>
<updated>2024-12-02T12:38:18+00:00</updated>
<author>
<name>lcnr</name>
<email>rust@lcnr.de</email>
</author>
<published>2024-12-02T12:23:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8b90e70e0634a3392b77f514c9755058b1fb85f7'/>
<id>urn:sha1:8b90e70e0634a3392b77f514c9755058b1fb85f7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rename `PASS_NAMES` to disambiguate</title>
<updated>2024-11-12T13:28:05+00:00</updated>
<author>
<name>clubby789</name>
<email>jamie@hill-daniel.co.uk</email>
</author>
<published>2024-11-11T16:51:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8c64e9d17dad7d6e8a9f00191d8f55bd14b44aef'/>
<id>urn:sha1:8c64e9d17dad7d6e8a9f00191d8f55bd14b44aef</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Store known passes as an IndexSet</title>
<updated>2024-11-12T13:28:05+00:00</updated>
<author>
<name>clubby789</name>
<email>jamie@hill-daniel.co.uk</email>
</author>
<published>2024-11-11T16:43:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=12036830d039134c447a1d7299a59560cd4a39d0'/>
<id>urn:sha1:12036830d039134c447a1d7299a59560cd4a39d0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Validate and test `-Zmir-enable-passes`</title>
<updated>2024-11-12T13:28:05+00:00</updated>
<author>
<name>clubby789</name>
<email>jamie@hill-daniel.co.uk</email>
</author>
<published>2024-11-11T16:36:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=94371d5a8cf3c0480a744e4727837e9d7b2281b0'/>
<id>urn:sha1:94371d5a8cf3c0480a744e4727837e9d7b2281b0</id>
<content type='text'>
</content>
</entry>
</feed>
