diff options
Diffstat (limited to 'crates/hir/src/code_model.rs')
-rw-r--r-- | crates/hir/src/code_model.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index dc3a1699f..a2a166e0a 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -926,12 +926,12 @@ impl MacroDef { | |||
926 | 926 | ||
927 | /// Indicate it is a proc-macro | 927 | /// Indicate it is a proc-macro |
928 | pub fn is_proc_macro(&self) -> bool { | 928 | pub fn is_proc_macro(&self) -> bool { |
929 | matches!(self.id.kind, MacroDefKind::CustomDerive(_)) | 929 | matches!(self.id.kind, MacroDefKind::ProcMacro(_)) |
930 | } | 930 | } |
931 | 931 | ||
932 | /// Indicate it is a derive macro | 932 | /// Indicate it is a derive macro |
933 | pub fn is_derive_macro(&self) -> bool { | 933 | pub fn is_derive_macro(&self) -> bool { |
934 | matches!(self.id.kind, MacroDefKind::CustomDerive(_) | MacroDefKind::BuiltInDerive(_)) | 934 | matches!(self.id.kind, MacroDefKind::ProcMacro(_) | MacroDefKind::BuiltInDerive(_)) |
935 | } | 935 | } |
936 | } | 936 | } |
937 | 937 | ||
@@ -1309,6 +1309,8 @@ impl Type { | |||
1309 | /// Checks that particular type `ty` implements `std::future::Future`. | 1309 | /// Checks that particular type `ty` implements `std::future::Future`. |
1310 | /// This function is used in `.await` syntax completion. | 1310 | /// This function is used in `.await` syntax completion. |
1311 | pub fn impls_future(&self, db: &dyn HirDatabase) -> bool { | 1311 | pub fn impls_future(&self, db: &dyn HirDatabase) -> bool { |
1312 | // No special case for the type of async block, since Chalk can figure it out. | ||
1313 | |||
1312 | let krate = self.krate; | 1314 | let krate = self.krate; |
1313 | 1315 | ||
1314 | let std_future_trait = | 1316 | let std_future_trait = |
@@ -1626,6 +1628,11 @@ impl Type { | |||
1626 | cb(type_.derived(ty.clone())); | 1628 | cb(type_.derived(ty.clone())); |
1627 | } | 1629 | } |
1628 | } | 1630 | } |
1631 | TypeCtor::OpaqueType(..) => { | ||
1632 | if let Some(bounds) = ty.impl_trait_bounds(db) { | ||
1633 | walk_bounds(db, &type_.derived(ty.clone()), &bounds, cb); | ||
1634 | } | ||
1635 | } | ||
1629 | _ => (), | 1636 | _ => (), |
1630 | } | 1637 | } |
1631 | 1638 | ||