aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-01-03 14:16:09 +0000
committerKirill Bulatov <[email protected]>2021-01-04 15:44:27 +0000
commited1ef3ae13a8f7bc2144bd06d0271d9a6e3205a0 (patch)
treec524b8a4929d6932a04d3dc9e55bfb8f13a6215d
parentec316cb21117dbefacd67af2f33779fb2d66fdea (diff)
Do not collect trait type aliases
-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 "#]],