Skip to content

Commit 537f869

Browse files
committed
Use an indexmap in IdAliasStore
1 parent 338ebb6 commit 537f869

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chalk-solve/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ rustc-hash = { version = "1.1.0" }
2020

2121
chalk-derive = { version = "0.76.0-dev.0", path = "../chalk-derive" }
2222
chalk-ir = { version = "0.76.0-dev.0", path = "../chalk-ir" }
23+
indexmap = "1.6.2"
2324

2425
[dev-dependencies]
2526
chalk-integration = { path = "../chalk-integration" }

chalk-solve/src/display/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ enum UnifiedId<I: Interner> {
4646
pub struct IdAliasStore<T> {
4747
/// Map from the DefIds we've encountered to a u32 alias id unique to all ids
4848
/// the same name.
49-
aliases: BTreeMap<T, u32>,
49+
aliases: indexmap::IndexMap<T, u32>,
5050
/// Map from each name to the next unused u32 alias id.
5151
next_unused_for_name: BTreeMap<String, u32>,
5252
}
5353

5454
impl<T> Default for IdAliasStore<T> {
5555
fn default() -> Self {
5656
IdAliasStore {
57-
aliases: BTreeMap::default(),
57+
aliases: indexmap::IndexMap::default(),
5858
next_unused_for_name: BTreeMap::default(),
5959
}
6060
}

0 commit comments

Comments
 (0)