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

@ -25,8 +25,7 @@ use crate::{
BodySourceMap,
},
ids::LocationCtx,
name,
path::PathKind,
path::known,
resolve::{ScopeDef, TypeNs, ValueNs},
ty::method_resolution::implements_trait,
AsName, AstId, Const, Crate, DefWithBody, Either, Enum, Function, HasBody, HirFileId, MacroDef,
@ -433,10 +432,7 @@ impl SourceAnalyzer {
/// Checks that particular type `ty` implements `std::future::Future`.
/// This function is used in `.await` syntax completion.
pub fn impls_future(&self, db: &impl HirDatabase, ty: Ty) -> bool {
let std_future_path = Path::from_simple_segments(
PathKind::Abs,
vec![name::STD, name::FUTURE_MOD, name::FUTURE_TYPE],
);
let std_future_path = known::std_future_future();
let std_future_trait = match self.resolver.resolve_known_trait(db, &std_future_path) {
Some(it) => it,