From ed1ef3ae13a8f7bc2144bd06d0271d9a6e3205a0 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 3 Jan 2021 16:16:09 +0200 Subject: Do not collect trait type aliases --- crates/hir_def/src/import_map.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'crates/hir_def') 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 { original_import_info: &ImportInfo, ) { for (assoc_item_name, item) in &db.trait_data(tr).items { - let module_def_id = match *item { - AssocItemId::FunctionId(f) => f.into(), - AssocItemId::ConstId(c) => c.into(), - AssocItemId::TypeAliasId(t) => t.into(), + let module_def_id = match item { + AssocItemId::FunctionId(f) => ModuleDefId::from(*f), + AssocItemId::ConstId(c) => ModuleDefId::from(*c), + // cannot use associated type aliases directly: need a `::TypeAlias` + // qualifier, ergo no need to store it for imports in import_map + AssocItemId::TypeAliasId(_) => continue, }; let assoc_item = if is_type_in_ns { ItemInNs::Types(module_def_id) @@ -799,7 +801,6 @@ mod tests { dep::fmt (t) dep::fmt::Display (t) dep::fmt::Display::FMT_CONST (a) - dep::fmt::Display::FmtTypeAlias (a) dep::fmt::Display::format_function (a) dep::fmt::Display::format_method (a) "#]], -- cgit v1.2.3