aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/expr')
-rw-r--r--crates/ra_hir/src/expr/validation.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_hir/src/expr/validation.rs b/crates/ra_hir/src/expr/validation.rs
index 6a22e1318..c985dbdad 100644
--- a/crates/ra_hir/src/expr/validation.rs
+++ b/crates/ra_hir/src/expr/validation.rs
@@ -11,7 +11,7 @@ use crate::{
11 name, 11 name,
12 path::{PathKind, PathSegment}, 12 path::{PathKind, PathSegment},
13 ty::{ApplicationTy, InferenceResult, Ty, TypeCtor}, 13 ty::{ApplicationTy, InferenceResult, Ty, TypeCtor},
14 Function, ModuleDef, Name, Path, PerNs, Resolution, 14 Function, Name, Path,
15}; 15};
16 16
17use super::{Expr, ExprId, RecordLitField}; 17use super::{Expr, ExprId, RecordLitField};
@@ -119,11 +119,10 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
119 }; 119 };
120 120
121 let resolver = self.func.resolver(db); 121 let resolver = self.func.resolver(db);
122 let std_result_enum = 122 let std_result_enum = match resolver.resolve_known_enum(db, &std_result_path) {
123 match resolver.resolve_path_segments(db, &std_result_path).into_fully_resolved() { 123 Some(it) => it,
124 PerNs { types: Some(Resolution::Def(ModuleDef::Enum(e))), .. } => e, 124 _ => return,
125 _ => return, 125 };
126 };
127 126
128 let std_result_ctor = TypeCtor::Adt(AdtDef::Enum(std_result_enum)); 127 let std_result_ctor = TypeCtor::Adt(AdtDef::Enum(std_result_enum));
129 let params = match &mismatch.expected { 128 let params = match &mismatch.expected {