Define known paths and group names

This commit is contained in:
uHOOCCOOHu 2019-09-15 20:14:33 +08:00
parent de9670fe45
commit 7ed3be3291
No known key found for this signature in database
GPG key ID: CED392DE0C483D00
6 changed files with 63 additions and 49 deletions

View file

@ -7,8 +7,7 @@ use crate::{
db::HirDatabase,
diagnostics::{DiagnosticSink, MissingFields, MissingOkInTailExpr},
expr::AstPtr,
name,
path::PathKind,
path::known,
ty::{ApplicationTy, InferenceResult, Ty, TypeCtor},
Adt, Function, Name, Path,
};
@ -108,10 +107,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
None => return,
};
let std_result_path = Path::from_simple_segments(
PathKind::Abs,
vec![name::STD, name::RESULT_MOD, name::RESULT_TYPE],
);
let std_result_path = known::std_result_result();
let resolver = self.func.resolver(db);
let std_result_enum = match resolver.resolve_known_enum(db, &std_result_path) {