diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/ty/traits.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/traits.rs b/crates/ra_hir/src/ty/traits.rs index f70a32575..4bbc99f0e 100644 --- a/crates/ra_hir/src/ty/traits.rs +++ b/crates/ra_hir/src/ty/traits.rs | |||
@@ -1,6 +1,7 @@ | |||
1 | //! Trait solving using Chalk. | 1 | //! Trait solving using Chalk. |
2 | use std::sync::{Arc, Mutex}; | 2 | use std::sync::{Arc, Mutex}; |
3 | 3 | ||
4 | use rustc_hash::FxHashSet; | ||
4 | use log::debug; | 5 | use log::debug; |
5 | use chalk_ir::cast::Cast; | 6 | use chalk_ir::cast::Cast; |
6 | 7 | ||
@@ -31,7 +32,7 @@ pub(crate) fn impls_for_trait( | |||
31 | krate: Crate, | 32 | krate: Crate, |
32 | trait_: Trait, | 33 | trait_: Trait, |
33 | ) -> Arc<[ImplBlock]> { | 34 | ) -> Arc<[ImplBlock]> { |
34 | let mut impls = Vec::new(); | 35 | let mut impls = FxHashSet::default(); |
35 | // We call the query recursively here. On the one hand, this means we can | 36 | // We call the query recursively here. On the one hand, this means we can |
36 | // reuse results from queries for different crates; on the other hand, this | 37 | // reuse results from queries for different crates; on the other hand, this |
37 | // will only ever get called for a few crates near the root of the tree (the | 38 | // will only ever get called for a few crates near the root of the tree (the |
@@ -42,7 +43,7 @@ pub(crate) fn impls_for_trait( | |||
42 | } | 43 | } |
43 | let crate_impl_blocks = db.impls_in_crate(krate); | 44 | let crate_impl_blocks = db.impls_in_crate(krate); |
44 | impls.extend(crate_impl_blocks.lookup_impl_blocks_for_trait(&trait_)); | 45 | impls.extend(crate_impl_blocks.lookup_impl_blocks_for_trait(&trait_)); |
45 | impls.into() | 46 | impls.into_iter().collect::<Vec<_>>().into() |
46 | } | 47 | } |
47 | 48 | ||
48 | fn solve( | 49 | fn solve( |