diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-02-24 02:11:32 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-24 02:11:32 -0500 |
| commit | 6aa015ae9d7c0ebf95f1daabc77c5cb147b54d26 (patch) | |
| tree | 7ccccc7162f1936c4d34cd306e8e532c524cb16f /compiler/rustc_data_structures/src | |
| parent | e0be1a02626abef2878cb7f4aaef7ae409477112 (diff) | |
| parent | 162fb713ac66fef8f6a1d14bae9d1d4b35f76411 (diff) | |
| download | rust-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_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/sorted_map/index_map.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/sorted_map/index_map.rs b/compiler/rustc_data_structures/src/sorted_map/index_map.rs index 1654867739f..b38b09d60eb 100644 --- a/compiler/rustc_data_structures/src/sorted_map/index_map.rs +++ b/compiler/rustc_data_structures/src/sorted_map/index_map.rs @@ -147,7 +147,7 @@ impl<I: Idx, K: Ord, V> FromIterator<(K, V)> for SortedIndexMultiMap<I, K, V> { where J: IntoIterator<Item = (K, V)>, { - let items = IndexVec::from_iter(iter); + let items = IndexVec::<I, _>::from_iter(iter); let mut idx_sorted_by_item_key: Vec<_> = items.indices().collect(); // `sort_by_key` is stable, so insertion order is preserved for duplicate items. |
