<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_mir_dataflow/src/framework, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<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>Eliminate unnecessary dependency from `rustc_mir_dataflow` to `rustc_hir`</title>
<updated>2025-08-20T22:04:00+00:00</updated>
<author>
<name>Josh Triplett</name>
<email>josh@joshtriplett.org</email>
</author>
<published>2025-08-14T09:40:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bad4f5c13fa3c48cdc888c2f38bebf8c36440ccc'/>
<id>urn:sha1:bad4f5c13fa3c48cdc888c2f38bebf8c36440ccc</id>
<content type='text'>
`rustc_mir_dataflow` only uses `DefId`, which is a re-export from
`rustc_span`.
</content>
</entry>
<entry>
<title>Escape diff strings in graphviz</title>
<updated>2025-08-08T05:20:55+00:00</updated>
<author>
<name>Amogh Shivaram</name>
<email>ashivaram264@gmail.com</email>
</author>
<published>2025-08-08T05:20:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=997c6a88216ac6a11bb864ab92fa4cf3da72f019'/>
<id>urn:sha1:997c6a88216ac6a11bb864ab92fa4cf3da72f019</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove support for SwitchInt edge effects in backward dataflow analyses</title>
<updated>2025-07-11T08:56:50+00:00</updated>
<author>
<name>Tomasz Miąsko</name>
<email>tomasz.miasko@gmail.com</email>
</author>
<published>2025-07-11T06:43:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5b6d661039116ea573652393938061a9a2a2c586'/>
<id>urn:sha1:5b6d661039116ea573652393938061a9a2a2c586</id>
<content type='text'>
Those effects are untested and unused. Remove them along with
the implementation of `BasicBlocks::switch_sources`.
</content>
</entry>
<entry>
<title>Call `get_switch_int_data` on a block with SwitchInt terminator</title>
<updated>2025-07-11T06:49:11+00:00</updated>
<author>
<name>Tomasz Miąsko</name>
<email>tomasz.miasko@gmail.com</email>
</author>
<published>2025-07-11T06:10:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=011d4aa81f1d20b4923a01c7162caa5f0042b8ba'/>
<id>urn:sha1:011d4aa81f1d20b4923a01c7162caa5f0042b8ba</id>
<content type='text'>
Fix a mix-up of a block with its predecessors in handling of SwitchInt
edge effects for backward analysis. Note that this functionality is
currently unused, so change has no practical impact.
</content>
</entry>
<entry>
<title>Auto merge of #142707 - ashivaram23:drop_wildcard, r=dianqk</title>
<updated>2025-07-09T03:42:01+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-07-09T03:42:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d350797b7e1a5b6952f5035cbad2a21613b32f6c'/>
<id>urn:sha1:d350797b7e1a5b6952f5035cbad2a21613b32f6c</id>
<content type='text'>
Apply effects to `otherwise` edge in dataflow analysis

This allows `ElaborateDrops` to remove drops when a `match` wildcard arm covers multiple no-Drop enum variants. It modifies dataflow analysis to update the `MaybeUninitializedPlaces` and `MaybeInitializedPlaces` data for a block reached through an `otherwise` edge.

Fixes rust-lang/rust#142705.
</content>
</entry>
<entry>
<title>Apply effects to otherwise edge in dataflow analysis</title>
<updated>2025-07-08T23:15:05+00:00</updated>
<author>
<name>Amogh Shivaram</name>
<email>ashivaram264@gmail.com</email>
</author>
<published>2025-07-08T23:15:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c7ef03aeb7c33825e3d020c9e1791171e71cd445'/>
<id>urn:sha1:c7ef03aeb7c33825e3d020c9e1791171e71cd445</id>
<content type='text'>
</content>
</entry>
<entry>
<title>mir: Use the `new` method for `BasicBlockData`</title>
<updated>2025-06-29T12:39:13+00:00</updated>
<author>
<name>dianqk</name>
<email>dianqk@dianqk.net</email>
</author>
<published>2025-06-16T14:31:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=24e553e6bcfa329b04b93c0978e00b492224a255'/>
<id>urn:sha1:24e553e6bcfa329b04b93c0978e00b492224a255</id>
<content type='text'>
</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>Separate `Analysis` and `Results`.</title>
<updated>2025-04-24T01:36:07+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-04-18T00:46:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=92799b6f89d2d9bbfcb9b11d1bac57899d0bc435'/>
<id>urn:sha1:92799b6f89d2d9bbfcb9b11d1bac57899d0bc435</id>
<content type='text'>
`Results` contains and `Analysis` and an `EntryStates`. The unfortunate
thing about this is that the analysis needs to be mutable everywhere
(`&amp;mut Analysis`) which forces the `Results` to be mutable everywhere,
even though `EntryStates` is immutable everywhere.

To fix this, this commit renames `Results` as `AnalysisAndResults`,
renames `EntryStates` as `Results`, and separates the analysis and
results as much as possible. (`AnalysisAndResults` doesn't get much use,
it's mostly there to facilitate method chaining of
`iterate_to_fixpoint`.)

`Results` is immutable everywhere, which:
- is a bit clearer on how the data is used,
- avoids an unnecessary clone of entry states in
  `locals_live_across_suspend_points`, and
- moves the results outside the `RefCell` in Formatter.

The commit also reformulates `ResultsHandle` as the generic `CowMut`,
which is simpler than `ResultsHandle` because it doesn't need the
`'tcx` lifetime and the trait bounds. It also which sits nicely
alongside the new use of `Cow` in `ResultsCursor`.
</content>
</entry>
</feed>
