From 4926bed42680d329f906be93450bec6b2ba0e99b Mon Sep 17 00:00:00 2001 From: uHOOCCOOHu Date: Thu, 12 Sep 2019 02:01:07 +0800 Subject: Support path starting with a type --- crates/ra_hir/src/expr/validation.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'crates/ra_hir/src/expr/validation.rs') diff --git a/crates/ra_hir/src/expr/validation.rs b/crates/ra_hir/src/expr/validation.rs index 030ec53a2..c675bf8de 100644 --- a/crates/ra_hir/src/expr/validation.rs +++ b/crates/ra_hir/src/expr/validation.rs @@ -8,7 +8,7 @@ use crate::{ diagnostics::{DiagnosticSink, MissingFields, MissingOkInTailExpr}, expr::AstPtr, name, - path::{PathKind, PathSegment}, + path::PathKind, ty::{ApplicationTy, InferenceResult, Ty, TypeCtor}, Adt, Function, Name, Path, }; @@ -108,14 +108,10 @@ impl<'a, 'b> ExprValidator<'a, 'b> { None => return, }; - let std_result_path = Path { - kind: PathKind::Abs, - segments: vec![ - PathSegment { name: name::STD, args_and_bindings: None }, - PathSegment { name: name::RESULT_MOD, args_and_bindings: None }, - PathSegment { name: name::RESULT_TYPE, args_and_bindings: None }, - ], - }; + let std_result_path = Path::from_simple_segments( + PathKind::Abs, + vec![name::STD, name::RESULT_MOD, name::RESULT_TYPE], + ); let resolver = self.func.resolver(db); let std_result_enum = match resolver.resolve_known_enum(db, &std_result_path) { -- cgit v1.2.3