diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-16 13:43:21 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-16 13:43:21 +0100 |
commit | ba583091e60553633dd3cc9ab37a1d9f64827a1e (patch) | |
tree | 41a9b72f46b1119ff32964f77365459fdb46a37d /crates/ra_hir/src/source_binder.rs | |
parent | 6b33b90091b0cecd4c092d34451aba9f2492063c (diff) | |
parent | 7ed3be32916facf3b709d5277381408cd3ec134a (diff) |
Merge #1817
1817: Support path starting with a type r=matklad a=uHOOCCOOHu
The path syntax `<Ty>::foo`
Co-authored-by: uHOOCCOOHu <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index cff55b640..2a907c9f1 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -25,8 +25,7 @@ use crate::{ | |||
25 | BodySourceMap, | 25 | BodySourceMap, |
26 | }, | 26 | }, |
27 | ids::LocationCtx, | 27 | ids::LocationCtx, |
28 | name, | 28 | path::known, |
29 | path::{PathKind, PathSegment}, | ||
30 | resolve::{ScopeDef, TypeNs, ValueNs}, | 29 | resolve::{ScopeDef, TypeNs, ValueNs}, |
31 | ty::method_resolution::implements_trait, | 30 | ty::method_resolution::implements_trait, |
32 | AsName, AstId, Const, Crate, DefWithBody, Either, Enum, Function, HasBody, HirFileId, MacroDef, | 31 | AsName, AstId, Const, Crate, DefWithBody, Either, Enum, Function, HasBody, HirFileId, MacroDef, |
@@ -433,14 +432,7 @@ impl SourceAnalyzer { | |||
433 | /// Checks that particular type `ty` implements `std::future::Future`. | 432 | /// Checks that particular type `ty` implements `std::future::Future`. |
434 | /// This function is used in `.await` syntax completion. | 433 | /// This function is used in `.await` syntax completion. |
435 | pub fn impls_future(&self, db: &impl HirDatabase, ty: Ty) -> bool { | 434 | pub fn impls_future(&self, db: &impl HirDatabase, ty: Ty) -> bool { |
436 | let std_future_path = Path { | 435 | let std_future_path = known::std_future_future(); |
437 | kind: PathKind::Abs, | ||
438 | segments: vec![ | ||
439 | PathSegment { name: name::STD, args_and_bindings: None }, | ||
440 | PathSegment { name: name::FUTURE_MOD, args_and_bindings: None }, | ||
441 | PathSegment { name: name::FUTURE_TYPE, args_and_bindings: None }, | ||
442 | ], | ||
443 | }; | ||
444 | 436 | ||
445 | let std_future_trait = match self.resolver.resolve_known_trait(db, &std_future_path) { | 437 | let std_future_trait = match self.resolver.resolve_known_trait(db, &std_future_path) { |
446 | Some(it) => it, | 438 | Some(it) => it, |