Skip to content

Commit

Permalink
Use indexset in impl LowerWithEnv for [QuantifiedInlineBound]
Browse files Browse the repository at this point in the history
  • Loading branch information
pierwill committed Dec 15, 2021
1 parent 7a80b58 commit cfe63d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions chalk-integration/src/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use chalk_ir::{
};
use chalk_parse::ast::*;
use chalk_solve::rust_ir::{self, IntoWhereClauses};
use indexmap::IndexMap;
use indexmap::{IndexMap, IndexSet};
use program_lowerer::ProgramLowerer;
use string_cache::DefaultAtom as Atom;
use tracing::debug;
Expand Down Expand Up @@ -542,7 +542,7 @@ impl LowerWithEnv for QuantifiedInlineBound {
}

impl LowerWithEnv for [QuantifiedInlineBound] {
type Lowered = Vec<rust_ir::QuantifiedInlineBound<ChalkIr>>;
type Lowered = IndexSet<rust_ir::QuantifiedInlineBound<ChalkIr>>;

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

let mut regular_traits = Vec::new();
let mut auto_traits = Vec::new();
let mut regular_traits = IndexSet::new();
let mut auto_traits = IndexSet::new();

for b in self {
let id = env.lookup_trait(trait_identifier(&b.bound))?;
if env.auto_trait(id) {
auto_traits.push((b, id))
auto_traits.insert((b, id))
} else {
regular_traits.push((b, id))
regular_traits.insert((b, id))
}
}

Expand Down

0 comments on commit cfe63d7

Please sign in to comment.