Skip to content

Commit d270a5e

Browse files
committed
import indexmap
1 parent 045f19d commit d270a5e

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

chalk-solve/src/coherence.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use chalk_ir::{self, ImplId, TraitId};
77
use std::fmt;
88
use std::sync::Arc;
99

10+
use indexmap::IndexMap;
11+
1012
pub mod orphan;
1113
mod solve;
1214

@@ -41,13 +43,13 @@ impl<I: Interner> std::error::Error for CoherenceError<I> {}
4143
/// This basically encodes which impls specialize one another.
4244
#[derive(Clone, Debug, Default, PartialEq, Eq)]
4345
pub struct SpecializationPriorities<I: Interner> {
44-
map: indexmap::IndexMap<ImplId<I>, SpecializationPriority>,
46+
map: IndexMap<ImplId<I>, SpecializationPriority>,
4547
}
4648

4749
impl<I: Interner> SpecializationPriorities<I> {
4850
pub fn new() -> Self {
4951
Self {
50-
map: indexmap::IndexMap::new(),
52+
map: IndexMap::new(),
5153
}
5254
}
5355

chalk-solve/src/display/state.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//! Persistent state passed down between writers.
21
//!
32
//! This is essentially `InternalWriterState` and other things supporting that.
43
use std::{
@@ -12,6 +11,7 @@ use std::{
1211

1312
use crate::RustIrDatabase;
1413
use chalk_ir::{interner::Interner, *};
14+
use indexmap::IndexMap;
1515
use itertools::Itertools;
1616

1717
/// Like a BoundVar, but with the debrujin index inverted so as to create a
@@ -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: indexmap::IndexMap<T, u32>,
49+
aliases: 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: indexmap::IndexMap::default(),
57+
aliases: IndexMap::default(),
5858
next_unused_for_name: BTreeMap::default(),
5959
}
6060
}

chalk-solve/src/logging_db.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ use crate::{
1616
};
1717
use chalk_ir::{interner::Interner, *};
1818

19+
use indexmap::IndexSet;
20+
1921
mod id_collector;
2022

2123
/// Wraps another `RustIrDatabase` (`DB`) and records which definitions are
@@ -34,7 +36,7 @@ where
3436
I: Interner,
3537
{
3638
ws: WriterState<I, DB, P>,
37-
def_ids: Mutex<indexmap::IndexSet<RecordedItemId<I>>>,
39+
def_ids: Mutex<IndexSet<RecordedItemId<I>>>,
3840
_phantom: PhantomData<DB>,
3941
}
4042

chalk-solve/src/logging_db/id_collector.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use chalk_ir::{
88
};
99
use std::ops::ControlFlow;
1010

11+
use indexmap::IndexSet;
12+
1113
/// Collects the identifiers needed to resolve all the names for a given
1214
/// set of identifers, excluding identifiers we already have.
1315
///
@@ -33,11 +35,11 @@ use std::ops::ControlFlow;
3335
/// resolution is successful.
3436
pub fn collect_unrecorded_ids<'i, I: Interner, DB: RustIrDatabase<I>>(
3537
db: &'i DB,
36-
identifiers: &'_ indexmap::IndexSet<RecordedItemId<I>>,
37-
) -> indexmap::IndexSet<RecordedItemId<I>> {
38+
identifiers: &'_ IndexSet<RecordedItemId<I>>,
39+
) -> IndexSet<RecordedItemId<I>> {
3840
let mut collector = IdCollector {
3941
db,
40-
found_identifiers: indexmap::IndexSet::new(),
42+
found_identifiers: IndexSet::new(),
4143
};
4244
for id in identifiers {
4345
match *id {
@@ -95,7 +97,7 @@ pub fn collect_unrecorded_ids<'i, I: Interner, DB: RustIrDatabase<I>>(
9597

9698
struct IdCollector<'i, I: Interner, DB: RustIrDatabase<I>> {
9799
db: &'i DB,
98-
found_identifiers: indexmap::IndexSet<RecordedItemId<I>>,
100+
found_identifiers: IndexSet<RecordedItemId<I>>,
99101
}
100102

101103
impl<'i, I: Interner, DB: RustIrDatabase<I>> IdCollector<'i, I, DB> {

0 commit comments

Comments
 (0)