Files
rust/compiler/rustc_index
Amanda Stjerna 219a65fa36 Simplify the initialisation of region values in region_infer
- `RegionInferenceContext::init_free_and_bound_regions()` is inlined into `::new()` and pulled to before initial SCC values are assigned
- A couple of iteration-then-index patterns are changed into `iter_enumerated()`-style patterns
- Some leftover code comments are removed and revised to actually describe the initialisation
- Free regions are now marked as live everywhere in liveness constraints, then copied to scc_values upon initialisation, avoiding performing that logic twice

It should do strictly less work, but almost all of it would only happen on free regions, and there shouldn't be large numbers of those. Depending on the cleverness of the optimiser most of the option/some checks should have been compiled away anyway.

The key advantage as I see it is clearer flow: first liveness constraints are set up, then initial values are initialised, then region inference is ready to run.
2026-06-09 18:06:54 +02:00
..