<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_mir_build/src/builder/mod.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-09-26T09:25:56+00:00</updated>
<entry>
<title>fix doc comments to be more standard</title>
<updated>2025-09-26T09:25:56+00:00</updated>
<author>
<name>Marijn Schouten</name>
<email>mhkbst@gmail.com</email>
</author>
<published>2025-09-25T09:30:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fc703ec5c88e678a4931f7bb8ed86efc141775f7'/>
<id>urn:sha1:fc703ec5c88e678a4931f7bb8ed86efc141775f7</id>
<content type='text'>
</content>
</entry>
<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>Avoid unnecessary `mut`-ness for various 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-14T23:13:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d7faa5630daf13c3d298e81ac329bf048a0d5a01'/>
<id>urn:sha1:d7faa5630daf13c3d298e81ac329bf048a0d5a01</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #144780 - bjorn3:mir_build_debug, r=matthewjasper</title>
<updated>2025-08-21T21:57:50+00:00</updated>
<author>
<name>Jacob Pratt</name>
<email>jacob@jhpratt.dev</email>
</author>
<published>2025-08-21T21:57:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cd0972f6f5277f7910837bff4b639d665756e3d2'/>
<id>urn:sha1:cd0972f6f5277f7910837bff4b639d665756e3d2</id>
<content type='text'>
Add a method to dump MIR in the middle of MIR building

This makes it easier to debug issues with MIR building by inserting dump_for_debugging calls around the suspected code responsible for the bad MIR.
</content>
</entry>
<entry>
<title>Port `#[custom_mir(..)]` to the new attribute system</title>
<updated>2025-08-15T09:19:29+00:00</updated>
<author>
<name>Sasha Pourcelot</name>
<email>sasha.pourcelot@protonmail.com</email>
</author>
<published>2025-08-10T07:44:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=51bccdd1ab0802dd5a55bd06e956c8d547bdec2d'/>
<id>urn:sha1:51bccdd1ab0802dd5a55bd06e956c8d547bdec2d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Also dump coverage info</title>
<updated>2025-08-13T14:37:50+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2025-08-13T14:26:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=695473ae676756935192644c026945dc3d2da318'/>
<id>urn:sha1:695473ae676756935192644c026945dc3d2da318</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add a method to dump MIR in the middle of MIR building</title>
<updated>2025-08-13T14:22:50+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2025-08-01T13:24:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7b13a509cc21dc49ae9c467038f04d9dd60994af'/>
<id>urn:sha1:7b13a509cc21dc49ae9c467038f04d9dd60994af</id>
<content type='text'>
This makes it easier to debug issues with MIR building by inserting
dump_for_debugging calls around the suspected code responsible for the
bad MIR.
</content>
</entry>
<entry>
<title>Remove useless lifetime parameter.</title>
<updated>2025-07-23T23:54:37+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2025-07-03T18:41:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0460c92d527dbada3fde227d3f01e6d1e132a186'/>
<id>urn:sha1:0460c92d527dbada3fde227d3f01e6d1e132a186</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reorder fields in `hir::ItemKind` variants.</title>
<updated>2025-05-29T16:23:20+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-05-28T05:18:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f8887aa5afd5ec20b3074e798c29146da3d91f91'/>
<id>urn:sha1:f8887aa5afd5ec20b3074e798c29146da3d91f91</id>
<content type='text'>
Specifically `TyAlias`, `Enum`, `Struct`, `Union`. So the fields match
the textual order in the source code.

The interesting part of the change is in
`compiler/rustc_hir/src/hir.rs`. The rest is extremely mechanical
refactoring.
</content>
</entry>
<entry>
<title>Rollup merge of #141357 - dianne:unhardcode-unpretty-thir-tree-body-expr, r=compiler-errors</title>
<updated>2025-05-21T20:15:01+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-05-21T20:15:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2663ea305105f756bc90c481c41d41d42f488ae2'/>
<id>urn:sha1:2663ea305105f756bc90c481c41d41d42f488ae2</id>
<content type='text'>
`unpretty=thir-tree`: don't require the final expr to be the body's value

Two motivations for this:
- I couldn't find a comment motivating this hard-coding. I can imagine it might be easier to read `unpretty=thir-flat` output if the final expression in the THIR is always the body's value, but if that's the reason, that should be the justification in the source. I can also imagine it's meant to check that all expressions will be visited by the pretty-printer, but the existing check doesn't quite do that either.
- Guard patterns (#129967) contain expressions, so lowering params containing guard patterns may add more expressions to the THIR. Currently a body's params are lowered after its expression, so guard expressions in params would end up last, breaking this. As an alternative, the params could be lowered first (#141356).
</content>
</entry>
</feed>
