aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/import_map.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/hir_def/src/import_map.rs b/crates/hir_def/src/import_map.rs
index a8bffe7ce..dd3a7198f 100644
--- a/crates/hir_def/src/import_map.rs
+++ b/crates/hir_def/src/import_map.rs
@@ -186,10 +186,12 @@ impl ImportMap {
186 original_import_info: &ImportInfo, 186 original_import_info: &ImportInfo,
187 ) { 187 ) {
188 for (assoc_item_name, item) in &db.trait_data(tr).items { 188 for (assoc_item_name, item) in &db.trait_data(tr).items {
189 let module_def_id = match *item { 189 let module_def_id = match item {
190 AssocItemId::FunctionId(f) => f.into(), 190 AssocItemId::FunctionId(f) => ModuleDefId::from(*f),
191 AssocItemId::ConstId(c) => c.into(), 191 AssocItemId::ConstId(c) => ModuleDefId::from(*c),
192 AssocItemId::TypeAliasId(t) => t.into(), 192 // cannot use associated type aliases directly: need a `<Struct as Trait>::TypeAlias`
193 // qualifier, ergo no need to store it for imports in import_map
194 AssocItemId::TypeAliasId(_) => continue,
193 }; 195 };
194 let assoc_item = if is_type_in_ns { 196 let assoc_item = if is_type_in_ns {
195 ItemInNs::Types(module_def_id) 197 ItemInNs::Types(module_def_id)
@@ -799,7 +801,6 @@ mod tests {
799 dep::fmt (t) 801 dep::fmt (t)
800 dep::fmt::Display (t) 802 dep::fmt::Display (t)
801 dep::fmt::Display::FMT_CONST (a) 803 dep::fmt::Display::FMT_CONST (a)
802 dep::fmt::Display::FmtTypeAlias (a)
803 dep::fmt::Display::format_function (a) 804 dep::fmt::Display::format_function (a)
804 dep::fmt::Display::format_method (a) 805 dep::fmt::Display::format_method (a)
805 "#]], 806 "#]],