From 739edfd5cf6d1f5ac1ec6dbc28fc7943b3936e24 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 15 Apr 2021 23:31:42 +0300 Subject: Exclude inherent traits from flyimports --- crates/hir_ty/src/lib.rs | 1 + crates/hir_ty/src/utils.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 113234fa4..0505fa4ae 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs @@ -56,6 +56,7 @@ pub use mapping::{ to_foreign_def_id, to_placeholder_idx, }; pub use traits::TraitEnvironment; +pub use utils::all_super_traits; pub use walk::TypeWalk; pub use chalk_ir::{ diff --git a/crates/hir_ty/src/utils.rs b/crates/hir_ty/src/utils.rs index 5f6cb052a..2f04ee57a 100644 --- a/crates/hir_ty/src/utils.rs +++ b/crates/hir_ty/src/utils.rs @@ -78,7 +78,7 @@ fn direct_super_trait_refs(db: &dyn HirDatabase, trait_ref: &TraitRef) -> Vec Vec { +pub fn all_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> Vec { // we need to take care a bit here to avoid infinite loops in case of cycles // (i.e. if we have `trait A: B; trait B: A;`) let mut result = vec![trait_]; -- cgit v1.2.3