diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-12 19:35:06 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-12 19:35:06 +0100 |
commit | d8b621cf26b59ff5ae9379b50fc822590b6a3a4e (patch) | |
tree | 381f2d4a92db5cdfd35c9e76d5c6b11bcb247c41 /crates/ra_hir/src/expr | |
parent | 5c09c5949a94012b5ae95735dc8c086efd5039e4 (diff) | |
parent | 63e1e63a9160d28597a8d77fd83c43a2c90d3f6b (diff) |
Merge #1832
1832: start cleaning up the resolution r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/expr')
-rw-r--r-- | crates/ra_hir/src/expr/validation.rs | 11 |
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 | ||
17 | use super::{Expr, ExprId, RecordLitField}; | 17 | use 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 { |