Skip to content

Commit cfe63d7

Browse files
committed
Use indexset in impl LowerWithEnv for [QuantifiedInlineBound]
1 parent 7a80b58 commit cfe63d7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

chalk-integration/src/lowering.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use chalk_ir::{
88
};
99
use chalk_parse::ast::*;
1010
use chalk_solve::rust_ir::{self, IntoWhereClauses};
11-
use indexmap::IndexMap;
11+
use indexmap::{IndexMap, IndexSet};
1212
use program_lowerer::ProgramLowerer;
1313
use string_cache::DefaultAtom as Atom;
1414
use tracing::debug;
@@ -542,7 +542,7 @@ impl LowerWithEnv for QuantifiedInlineBound {
542542
}
543543

544544
impl LowerWithEnv for [QuantifiedInlineBound] {
545-
type Lowered = Vec<rust_ir::QuantifiedInlineBound<ChalkIr>>;
545+
type Lowered = IndexSet<rust_ir::QuantifiedInlineBound<ChalkIr>>;
546546

547547
fn lower(&self, env: &Env) -> LowerResult<Self::Lowered> {
548548
fn trait_identifier(bound: &InlineBound) -> &Identifier {
@@ -552,15 +552,15 @@ impl LowerWithEnv for [QuantifiedInlineBound] {
552552
}
553553
}
554554

555-
let mut regular_traits = Vec::new();
556-
let mut auto_traits = Vec::new();
555+
let mut regular_traits = IndexSet::new();
556+
let mut auto_traits = IndexSet::new();
557557

558558
for b in self {
559559
let id = env.lookup_trait(trait_identifier(&b.bound))?;
560560
if env.auto_trait(id) {
561-
auto_traits.push((b, id))
561+
auto_traits.insert((b, id))
562562
} else {
563-
regular_traits.push((b, id))
563+
regular_traits.insert((b, id))
564564
}
565565
}
566566

0 commit comments

Comments
 (0)