aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer.rs
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-05-25 13:59:54 +0100
committerLukas Wirth <[email protected]>2021-05-25 13:59:54 +0100
commit3ee4e6c54c0bb9586c607dd8890d58fb21c95259 (patch)
treef4056812324bc4c27a188092e280e49bc1fefc1b /crates/hir_ty/src/infer.rs
parent835cf55887527bd1953cb7004259214f7c215095 (diff)
Fix type inference not working for new Try trait
Diffstat (limited to 'crates/hir_ty/src/infer.rs')
-rw-r--r--crates/hir_ty/src/infer.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs
index db3c937ff..edb65622f 100644
--- a/crates/hir_ty/src/infer.rs
+++ b/crates/hir_ty/src/infer.rs
@@ -580,7 +580,10 @@ impl<'a> InferenceContext<'a> {
580 fn resolve_ops_try_ok(&self) -> Option<TypeAliasId> { 580 fn resolve_ops_try_ok(&self) -> Option<TypeAliasId> {
581 let path = path![core::ops::Try]; 581 let path = path![core::ops::Try];
582 let trait_ = self.resolver.resolve_known_trait(self.db.upcast(), &path)?; 582 let trait_ = self.resolver.resolve_known_trait(self.db.upcast(), &path)?;
583 self.db.trait_data(trait_).associated_type_by_name(&name![Ok]) 583 let trait_data = self.db.trait_data(trait_);
584 trait_data
585 .associated_type_by_name(&name![Ok])
586 .or_else(|| trait_data.associated_type_by_name(&name![Output]))
584 } 587 }
585 588
586 fn resolve_ops_neg_output(&self) -> Option<TypeAliasId> { 589 fn resolve_ops_neg_output(&self) -> Option<TypeAliasId> {