mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Support path starting with a type
This commit is contained in:
parent
2d79a1ad83
commit
4926bed426
10 changed files with 210 additions and 127 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue