diff options
author | Florian Diebold <[email protected]> | 2019-05-11 22:54:41 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-05-12 19:21:45 +0100 |
commit | c8b85891b0c6c03a1b373491f75b8872ec47e06f (patch) | |
tree | 964c0b3bde542df5ddbe12932679be4f1df72ef5 | |
parent | 02ba107bbf24b1d09e61f76bb64b7355076744c4 (diff) |
Fix impl blocks with unresolved target trait being treated as inherent impls
-rw-r--r-- | crates/ra_hir/src/ty/method_resolution.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index d8b8c836c..e8cfa0b85 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs | |||
@@ -75,11 +75,13 @@ impl CrateImplBlocks { | |||
75 | 75 | ||
76 | let target_ty = impl_block.target_ty(db); | 76 | let target_ty = impl_block.target_ty(db); |
77 | 77 | ||
78 | if let Some(tr) = impl_block.target_trait_ref(db) { | 78 | if impl_block.target_trait(db).is_some() { |
79 | self.impls_by_trait | 79 | if let Some(tr) = impl_block.target_trait_ref(db) { |
80 | .entry(tr.trait_) | 80 | self.impls_by_trait |
81 | .or_insert_with(Vec::new) | 81 | .entry(tr.trait_) |
82 | .push((module.module_id, impl_id)); | 82 | .or_insert_with(Vec::new) |
83 | .push((module.module_id, impl_id)); | ||
84 | } | ||
83 | } else { | 85 | } else { |
84 | if let Some(target_ty_fp) = TyFingerprint::for_impl(&target_ty) { | 86 | if let Some(target_ty_fp) = TyFingerprint::for_impl(&target_ty) { |
85 | self.impls | 87 | self.impls |