about summary refs log tree commit diff
path: root/compiler/rustc_infer
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-02-24 02:11:32 -0500
committerGitHub <noreply@github.com>2025-02-24 02:11:32 -0500
commit6aa015ae9d7c0ebf95f1daabc77c5cb147b54d26 (patch)
tree7ccccc7162f1936c4d34cd306e8e532c524cb16f /compiler/rustc_infer
parente0be1a02626abef2878cb7f4aaef7ae409477112 (diff)
parent162fb713ac66fef8f6a1d14bae9d1d4b35f76411 (diff)
downloadrust-6aa015ae9d7c0ebf95f1daabc77c5cb147b54d26.tar.gz
rust-6aa015ae9d7c0ebf95f1daabc77c5cb147b54d26.zip
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.
Diffstat (limited to 'compiler/rustc_infer')
-rw-r--r--compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
index e454a88e847..03c4614af13 100644
--- a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
+++ b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
@@ -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)