about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-04-18 10:46:20 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-04-24 11:36:07 +1000
commit92799b6f89d2d9bbfcb9b11d1bac57899d0bc435 (patch)
treeab76629093e4f9aa2668aafe41cd4155ab1c5e4d /tests/rustdoc-js-std/parser-errors.js
parent4ff55588d33366d0572c1865b43dec8ac00237b1 (diff)
downloadrust-92799b6f89d2d9bbfcb9b11d1bac57899d0bc435.tar.gz
rust-92799b6f89d2d9bbfcb9b11d1bac57899d0bc435.zip
Separate `Analysis` and `Results`.
`Results` contains and `Analysis` and an `EntryStates`. The unfortunate
thing about this is that the analysis needs to be mutable everywhere
(`&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`.
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions