Rollup merge of #136610 - Jarcho:range_idx, r=Noratrieb
Allow `IndexSlice` to be indexed by ranges. This comes with some annoyances as the index type can no longer inferred from indexing expressions. The biggest offender for this is `IndexVec::from_fn_n(|idx| ..., n)` where the index type won't be inferred from the call site or any index expressions inside the closure. My main use case for this is mapping a `Place` to `Range<Idx>` for value tracking where the range represents all the values the place contains.
This commit is contained in:
commit
6aa015ae9d
12 changed files with 144 additions and 42 deletions
|
@ -160,7 +160,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
|||
/// empty region. The `expansion` phase will grow this larger.
|
||||
fn construct_var_data(&self) -> LexicalRegionResolutions<'tcx> {
|
||||
LexicalRegionResolutions {
|
||||
values: IndexVec::from_fn_n(
|
||||
values: IndexVec::<RegionVid, _>::from_fn_n(
|
||||
|vid| {
|
||||
let vid_universe = self.var_infos[vid].universe;
|
||||
VarValue::Empty(vid_universe)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue