rust/compiler/rustc_borrowck/src
Nicholas Nethercote 92799b6f89 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`.
2025-04-24 11:36:07 +10:00
..
constraints Split the Edges iterator. 2025-02-28 09:25:01 +11:00
diagnostics Use is_lang_item and as_lang_item instead of handrolling their logic 2025-04-22 11:02:37 +00:00
polonius move dump_polonius_mir 2025-04-11 12:12:34 +02:00
region_infer Use newtype_index!-generated types more idiomatically 2025-04-14 16:17:06 +00:00
type_check Rollup merge of #138393 - oli-obk:pattern-type-in-pattern, r=BoxyUwU 2025-04-15 15:47:25 +10:00
borrow_set.rs rename BitSet to DenseBitSet 2025-01-11 11:34:01 +00:00
borrowck_errors.rs Use closure parse code 2025-03-06 17:58:32 -03:00
consumers.rs borrowck typeck children together with their parent 2025-04-08 00:34:40 +02:00
dataflow.rs move out of scope precomputer code 2025-01-12 07:39:20 +00:00
def_use.rs Visit place in BackwardIncompatibleDropHint statement 2025-04-13 22:01:54 +00:00
lib.rs Separate Analysis and Results. 2025-04-24 11:36:07 +10:00
member_constraints.rs Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
nll.rs eagerly initialize definitions in sub-fn 2025-04-11 15:18:30 +02:00
path_utils.rs remove borrowck duplicate of std::ops::ControlFlow 2025-01-01 12:13:33 +00:00
place_ext.rs Remove #[macro_use] extern crate tracing from rustc_borrowck. 2024-08-30 17:14:53 +10:00
places_conflict.rs Implement MIR, CTFE, and codegen for unsafe binders 2025-01-31 17:19:53 +00:00
prefixes.rs Implement MIR, CTFE, and codegen for unsafe binders 2025-01-31 17:19:53 +00:00
renumber.rs Squash fold into ty 2025-03-15 06:34:36 +00:00
root_cx.rs move ClosureRegionRequirements to rustc_borrowck 2025-04-08 00:34:40 +02:00
session_diagnostics.rs move check_opaque_type_parameter_valid 2025-04-03 11:13:10 +02:00
universal_regions.rs remove redundant fields 2025-04-11 15:18:29 +02:00
used_muts.rs Remove unnecessary lifetimes in dataflow structs. 2024-09-09 16:14:18 +10:00