diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-14 14:08:08 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-14 14:08:08 +0000 |
commit | 77db6177658b32f69ad7ebfdef96c1b3b2893fdd (patch) | |
tree | 2a9f0f16b34821dfe4319bef410e177311e87f16 /crates/ra_hir | |
parent | 7238037de42a2fd88434930c521b926d7b0026da (diff) | |
parent | f02fcc16444fcd18ccd51b43fa01bf0233e044fa (diff) |
Merge #2554
2554: Add macros for known names and paths r=matklad a=flodiebold
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index c705d1630..7850ea9a7 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -17,7 +17,7 @@ use hir_def::{ | |||
17 | }; | 17 | }; |
18 | use hir_expand::{ | 18 | use hir_expand::{ |
19 | diagnostics::DiagnosticSink, | 19 | diagnostics::DiagnosticSink, |
20 | name::{self, AsName}, | 20 | name::{name, AsName}, |
21 | MacroDefId, | 21 | MacroDefId, |
22 | }; | 22 | }; |
23 | use hir_ty::{ | 23 | use hir_ty::{ |
@@ -723,7 +723,7 @@ impl Local { | |||
723 | } | 723 | } |
724 | 724 | ||
725 | pub fn is_self(self, db: &impl HirDatabase) -> bool { | 725 | pub fn is_self(self, db: &impl HirDatabase) -> bool { |
726 | self.name(db) == Some(name::SELF_PARAM) | 726 | self.name(db) == Some(name![self]) |
727 | } | 727 | } |
728 | 728 | ||
729 | pub fn is_mut(self, db: &impl HirDatabase) -> bool { | 729 | pub fn is_mut(self, db: &impl HirDatabase) -> bool { |
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index d3cc5c423..f82242c3a 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -15,7 +15,7 @@ use hir_def::{ | |||
15 | }, | 15 | }, |
16 | expr::{ExprId, PatId}, | 16 | expr::{ExprId, PatId}, |
17 | nameres::ModuleSource, | 17 | nameres::ModuleSource, |
18 | path::known, | 18 | path::path, |
19 | resolver::{self, resolver_for_scope, HasResolver, Resolver, TypeNs, ValueNs}, | 19 | resolver::{self, resolver_for_scope, HasResolver, Resolver, TypeNs, ValueNs}, |
20 | AssocItemId, DefWithBodyId, | 20 | AssocItemId, DefWithBodyId, |
21 | }; | 21 | }; |
@@ -418,7 +418,7 @@ impl SourceAnalyzer { | |||
418 | /// Checks that particular type `ty` implements `std::future::Future`. | 418 | /// Checks that particular type `ty` implements `std::future::Future`. |
419 | /// This function is used in `.await` syntax completion. | 419 | /// This function is used in `.await` syntax completion. |
420 | pub fn impls_future(&self, db: &impl HirDatabase, ty: Type) -> bool { | 420 | pub fn impls_future(&self, db: &impl HirDatabase, ty: Type) -> bool { |
421 | let std_future_path = known::std_future_future(); | 421 | let std_future_path = path![std::future::Future]; |
422 | 422 | ||
423 | let std_future_trait = match self.resolver.resolve_known_trait(db, &std_future_path) { | 423 | let std_future_trait = match self.resolver.resolve_known_trait(db, &std_future_path) { |
424 | Some(it) => it.into(), | 424 | Some(it) => it.into(), |