aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics/expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/diagnostics/expr.rs')
-rw-r--r--crates/hir_ty/src/diagnostics/expr.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs
index 66a88e2b6..2751cd304 100644
--- a/crates/hir_ty/src/diagnostics/expr.rs
+++ b/crates/hir_ty/src/diagnostics/expr.rs
@@ -2,9 +2,7 @@
2 2
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use hir_def::{ 5use hir_def::{expr::Statement, path::path, resolver::HasResolver, AssocItemId, DefWithBodyId};
6 expr::Statement, path::path, resolver::HasResolver, AdtId, AssocItemId, DefWithBodyId,
7};
8use hir_expand::{diagnostics::DiagnosticSink, name}; 6use hir_expand::{diagnostics::DiagnosticSink, name};
9use rustc_hash::FxHashSet; 7use rustc_hash::FxHashSet;
10use syntax::{ast, AstPtr}; 8use syntax::{ast, AstPtr};
@@ -17,7 +15,7 @@ use crate::{
17 MissingPatFields, RemoveThisSemicolon, 15 MissingPatFields, RemoveThisSemicolon,
18 }, 16 },
19 utils::variant_data, 17 utils::variant_data,
20 InferenceResult, Ty, 18 AdtId, InferenceResult, Ty,
21}; 19};
22 20
23pub(crate) use hir_def::{ 21pub(crate) use hir_def::{
@@ -382,10 +380,14 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
382 }; 380 };
383 381
384 let (params, required) = match mismatch.expected { 382 let (params, required) = match mismatch.expected {
385 Ty::Adt(AdtId::EnumId(enum_id), ref parameters) if enum_id == core_result_enum => { 383 Ty::Adt(AdtId(hir_def::AdtId::EnumId(enum_id)), ref parameters)
384 if enum_id == core_result_enum =>
385 {
386 (parameters, "Ok".to_string()) 386 (parameters, "Ok".to_string())
387 } 387 }
388 Ty::Adt(AdtId::EnumId(enum_id), ref parameters) if enum_id == core_option_enum => { 388 Ty::Adt(AdtId(hir_def::AdtId::EnumId(enum_id)), ref parameters)
389 if enum_id == core_option_enum =>
390 {
389 (parameters, "Some".to_string()) 391 (parameters, "Some".to_string())
390 } 392 }
391 _ => return, 393 _ => return,