<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_mir_dataflow/src/framework/results.rs, branch 1.90.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.90.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.90.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-04-24T01:36:07+00:00</updated>
<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>
<entry>
<title>Remove unnecessary lifetime on `ResultsVisitor`.</title>
<updated>2025-04-22T00:08:05+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-04-22T00:08:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=521b379705bcdd9ea41e8bce56bfd16ba1b90703'/>
<id>urn:sha1:521b379705bcdd9ea41e8bce56bfd16ba1b90703</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #133938 - nnethercote:rustc_mir_dataflow-renamings, r=oli-obk</title>
<updated>2024-12-13T16:25:29+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-12-13T16:25:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c6ebe6fe3bb538a17d9572cf5dcc26daa91bbdb6'/>
<id>urn:sha1:c6ebe6fe3bb538a17d9572cf5dcc26daa91bbdb6</id>
<content type='text'>
`rustc_mir_dataflow` cleanups, including some renamings

Some opinionated commits in this collection, let's see how we go.

r? `@cjgillot`
</content>
</entry>
<entry>
<title>Rename `EntrySets` as `EntryStates`.</title>
<updated>2024-12-10T01:04:45+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-11-26T03:21:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b059ea857cb39606c297378fefe6689d5723a4f6'/>
<id>urn:sha1:b059ea857cb39606c297378fefe6689d5723a4f6</id>
<content type='text'>
"Set" doesn't make much sense here, we refer to domain values as "state"
everywhere else. (This name confused me for a while.)
</content>
</entry>
<entry>
<title>Move `write_graphviz_results` from `results.rs` to `graphviz.rs`.</title>
<updated>2024-12-09T09:49:36+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-12-08T23:02:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=db760e27fd05e88bd1e1d2e48ce15c113e6e1c96'/>
<id>urn:sha1:db760e27fd05e88bd1e1d2e48ce15c113e6e1c96</id>
<content type='text'>
It's more graphviz-y than it is results-y. This lets us reduce
visibility of several types in `graphviz.rs`.
</content>
</entry>
<entry>
<title>Simplify `ResultsHandle`.</title>
<updated>2024-12-02T05:19:17+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-12-01T23:58:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cecef131a259320efb0a7d693ef4c594a3d93241'/>
<id>urn:sha1:cecef131a259320efb0a7d693ef4c594a3d93241</id>
<content type='text'>
The `Borrowed` variant is no longer used. This commit removes it, along
with the `as_results_cursor` method that produces it, and renames
`as_results_cursor_mut` as `as_results_cursor`.
</content>
</entry>
<entry>
<title>Fix crash with `-Zdump-mir-dataflow`</title>
<updated>2024-12-02T05:17:55+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-11-28T20:00:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d37ed10634131dd678697609f9060aaba8bacd41'/>
<id>urn:sha1:d37ed10634131dd678697609f9060aaba8bacd41</id>
<content type='text'>
As of #133155 `Formatter:new` uses `as_results_cursor` to create a
non-mutable results reference, and then later that is accessed via
`deref_mut` which results in a runtime abort. Changing to
`as_results_cursor_mut` fixes it.

Fixes #133641.
</content>
</entry>
<entry>
<title>Make it possible for `ResultsCursor` to borrow a `Results`.</title>
<updated>2024-11-26T00:23:40+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-11-18T05:04:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=be7c6a3b43a8d200ba29f5a768e32287bb95aec2'/>
<id>urn:sha1:be7c6a3b43a8d200ba29f5a768e32287bb95aec2</id>
<content type='text'>
`ResultsCursor` currently owns its `Results`. But sometimes the
`Results` is needed again afterwards. So there is
`ResultsCursor::into_results` for extracting the `Results`, which leads
to some awkwardness.

This commit adds `ResultsHandle`, a `Cow`-like type that can either
borrow or own a a `Results`. `ResultsCursor` now uses it. This is good
because some `ResultsCursor`s really want to own their `Results`, while
others just want to borrow it.

We end with with a few more lines of code, but get some nice cleanups.
- `ResultsCursor::into_results` and `Formatter::into_results` are
  removed.
- `write_graphviz_results` now just borrows a `Results`, instead of the
  awkward "take ownership of a `Results` and then return it unchanged"
  pattern.

This reinstates the cursor flexibility that was lost in #118230 -- which
removed the old `ResultsRefCursor` and `ResultsCloneCursor` types -- but
in a much simpler way. Hooray!
</content>
</entry>
<entry>
<title>Add some useful comments.</title>
<updated>2024-11-26T00:23:36+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-11-18T04:43:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7e704afc2d48df0f266ac592d0806c6770a3d08c'/>
<id>urn:sha1:7e704afc2d48df0f266ac592d0806c6770a3d08c</id>
<content type='text'>
Describing some things that took me a long time to understand.
</content>
</entry>
<entry>
<title>Remove `ResultsVisitable`.</title>
<updated>2024-11-04T23:18:03+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-10-31T01:33:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c904c6aaffa10f92e8f203f69bd8b87b0b0f4353'/>
<id>urn:sha1:c904c6aaffa10f92e8f203f69bd8b87b0b0f4353</id>
<content type='text'>
Now that `Results` is the only impl of `ResultsVisitable`, the trait can
be removed. This simplifies things by removining unnecessary layers of
indirection and abstraction.

- `ResultsVisitor` is simpler.
  - Its type parameter changes from `R` (an analysis result) to the
    simpler `A` (an analysis).
  - It no longer needs the `Domain` associated type, because it can use
    `A::Domain`.
  - Occurrences of `R` become `Results&lt;'tcx, A&gt;`, because there is now
    only one kind of analysis results.

- `save_as_intervals` also changes type parameter from `R` to `A`.

- The `results.reconstruct_*` method calls are replaced with
  `results.analysis.apply_*` method calls, which are equivalent.

- `Direction::visit_results_in_block` is simpler, with a single generic
  param (`A`) instead of two (`D` and `R`/`F`, with a bound connecting
  them). Likewise for `visit_results`.

- The `ResultsVisitor` impls for `MirBorrowCtxt` and
  `StorageConflictVisitor` are now specific about the type of the
  analysis results they work with. They both used to have a type param
  `R` but they weren't genuinely generic. In both cases there was only a
  single results type that made sense to instantiate them with.
</content>
</entry>
</feed>
