diff options
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/code_model.rs | 7 | ||||
-rw-r--r-- | crates/hir/src/semantics.rs | 8 | ||||
-rw-r--r-- | crates/hir/src/source_analyzer.rs | 4 |
3 files changed, 13 insertions, 6 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index c2fc819e7..7a9747fc7 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -1283,6 +1283,8 @@ impl Type { | |||
1283 | /// Checks that particular type `ty` implements `std::future::Future`. | 1283 | /// Checks that particular type `ty` implements `std::future::Future`. |
1284 | /// This function is used in `.await` syntax completion. | 1284 | /// This function is used in `.await` syntax completion. |
1285 | pub fn impls_future(&self, db: &dyn HirDatabase) -> bool { | 1285 | pub fn impls_future(&self, db: &dyn HirDatabase) -> bool { |
1286 | // No special case for the type of async block, since Chalk can figure it out. | ||
1287 | |||
1286 | let krate = self.krate; | 1288 | let krate = self.krate; |
1287 | 1289 | ||
1288 | let std_future_trait = | 1290 | let std_future_trait = |
@@ -1600,6 +1602,11 @@ impl Type { | |||
1600 | cb(type_.derived(ty.clone())); | 1602 | cb(type_.derived(ty.clone())); |
1601 | } | 1603 | } |
1602 | } | 1604 | } |
1605 | TypeCtor::OpaqueType(..) => { | ||
1606 | if let Some(bounds) = ty.impl_trait_bounds(db) { | ||
1607 | walk_bounds(db, &type_.derived(ty.clone()), &bounds, cb); | ||
1608 | } | ||
1609 | } | ||
1603 | _ => (), | 1610 | _ => (), |
1604 | } | 1611 | } |
1605 | 1612 | ||
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs index 1594d4f0f..0516a05b4 100644 --- a/crates/hir/src/semantics.rs +++ b/crates/hir/src/semantics.rs | |||
@@ -207,8 +207,8 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { | |||
207 | self.imp.resolve_record_field(field) | 207 | self.imp.resolve_record_field(field) |
208 | } | 208 | } |
209 | 209 | ||
210 | pub fn resolve_record_field_pat(&self, field: &ast::RecordPatField) -> Option<Field> { | 210 | pub fn resolve_record_pat_field(&self, field: &ast::RecordPatField) -> Option<Field> { |
211 | self.imp.resolve_record_field_pat(field) | 211 | self.imp.resolve_record_pat_field(field) |
212 | } | 212 | } |
213 | 213 | ||
214 | pub fn resolve_macro_call(&self, macro_call: &ast::MacroCall) -> Option<MacroDef> { | 214 | pub fn resolve_macro_call(&self, macro_call: &ast::MacroCall) -> Option<MacroDef> { |
@@ -433,8 +433,8 @@ impl<'db> SemanticsImpl<'db> { | |||
433 | self.analyze(field.syntax()).resolve_record_field(self.db, field) | 433 | self.analyze(field.syntax()).resolve_record_field(self.db, field) |
434 | } | 434 | } |
435 | 435 | ||
436 | fn resolve_record_field_pat(&self, field: &ast::RecordPatField) -> Option<Field> { | 436 | fn resolve_record_pat_field(&self, field: &ast::RecordPatField) -> Option<Field> { |
437 | self.analyze(field.syntax()).resolve_record_field_pat(self.db, field) | 437 | self.analyze(field.syntax()).resolve_record_pat_field(self.db, field) |
438 | } | 438 | } |
439 | 439 | ||
440 | fn resolve_macro_call(&self, macro_call: &ast::MacroCall) -> Option<MacroDef> { | 440 | fn resolve_macro_call(&self, macro_call: &ast::MacroCall) -> Option<MacroDef> { |
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs index 1d13c4f1d..1aef0f33f 100644 --- a/crates/hir/src/source_analyzer.rs +++ b/crates/hir/src/source_analyzer.rs | |||
@@ -179,13 +179,13 @@ impl SourceAnalyzer { | |||
179 | Some((struct_field.into(), local)) | 179 | Some((struct_field.into(), local)) |
180 | } | 180 | } |
181 | 181 | ||
182 | pub(crate) fn resolve_record_field_pat( | 182 | pub(crate) fn resolve_record_pat_field( |
183 | &self, | 183 | &self, |
184 | _db: &dyn HirDatabase, | 184 | _db: &dyn HirDatabase, |
185 | field: &ast::RecordPatField, | 185 | field: &ast::RecordPatField, |
186 | ) -> Option<Field> { | 186 | ) -> Option<Field> { |
187 | let pat_id = self.pat_id(&field.pat()?)?; | 187 | let pat_id = self.pat_id(&field.pat()?)?; |
188 | let struct_field = self.infer.as_ref()?.record_field_pat_resolution(pat_id)?; | 188 | let struct_field = self.infer.as_ref()?.record_pat_field_resolution(pat_id)?; |
189 | Some(struct_field.into()) | 189 | Some(struct_field.into()) |
190 | } | 190 | } |
191 | 191 | ||