diff options
Diffstat (limited to 'crates/ra_hir_ty/src/infer.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index 569d46cc3..377f44fa7 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs | |||
@@ -28,7 +28,7 @@ use hir_def::{ | |||
28 | path::{path, Path}, | 28 | path::{path, Path}, |
29 | resolver::{HasResolver, Resolver, TypeNs}, | 29 | resolver::{HasResolver, Resolver, TypeNs}, |
30 | type_ref::{Mutability, TypeRef}, | 30 | type_ref::{Mutability, TypeRef}, |
31 | AdtId, AssocItemId, DefWithBodyId, FunctionId, StructFieldId, TypeAliasId, VariantId, | 31 | AdtId, AssocItemId, DefWithBodyId, FunctionId, StructFieldId, TraitId, TypeAliasId, VariantId, |
32 | }; | 32 | }; |
33 | use hir_expand::{diagnostics::DiagnosticSink, name::name}; | 33 | use hir_expand::{diagnostics::DiagnosticSink, name::name}; |
34 | use ra_arena::map::ArenaMap; | 34 | use ra_arena::map::ArenaMap; |
@@ -540,8 +540,12 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
540 | Some(struct_.into()) | 540 | Some(struct_.into()) |
541 | } | 541 | } |
542 | 542 | ||
543 | fn resolve_ops_index(&self) -> Option<TraitId> { | ||
544 | self.resolve_lang_item("index")?.as_trait() | ||
545 | } | ||
546 | |||
543 | fn resolve_ops_index_output(&self) -> Option<TypeAliasId> { | 547 | fn resolve_ops_index_output(&self) -> Option<TypeAliasId> { |
544 | let trait_ = self.resolve_lang_item("index")?.as_trait()?; | 548 | let trait_ = self.resolve_ops_index()?; |
545 | self.db.trait_data(trait_).associated_type_by_name(&name![Output]) | 549 | self.db.trait_data(trait_).associated_type_by_name(&name![Output]) |
546 | } | 550 | } |
547 | } | 551 | } |