From 2a4166501d8990d3a489e89af3d92002540c288c Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 11 Jul 2020 16:29:09 +0200 Subject: Remove built-in Unsize impls They exist in Chalk now. --- crates/ra_hir_ty/src/utils.rs | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'crates/ra_hir_ty/src/utils.rs') diff --git a/crates/ra_hir_ty/src/utils.rs b/crates/ra_hir_ty/src/utils.rs index c45820ff0..e3e244268 100644 --- a/crates/ra_hir_ty/src/utils.rs +++ b/crates/ra_hir_ty/src/utils.rs @@ -110,38 +110,6 @@ pub(super) fn all_super_trait_refs(db: &dyn HirDatabase, trait_ref: TraitRef) -> result } -/// Finds a path from a trait to one of its super traits. Returns an empty -/// vector if there is no path. -pub(super) fn find_super_trait_path( - db: &dyn DefDatabase, - trait_: TraitId, - super_trait: TraitId, -) -> Vec { - let mut result = Vec::with_capacity(2); - result.push(trait_); - return if go(db, super_trait, &mut result) { result } else { Vec::new() }; - - fn go(db: &dyn DefDatabase, super_trait: TraitId, path: &mut Vec) -> bool { - let trait_ = *path.last().unwrap(); - if trait_ == super_trait { - return true; - } - - for tt in direct_super_traits(db, trait_) { - if path.contains(&tt) { - continue; - } - path.push(tt); - if go(db, super_trait, path) { - return true; - } else { - path.pop(); - } - } - false - } -} - pub(super) fn associated_type_by_name_including_super_traits( db: &dyn HirDatabase, trait_ref: TraitRef, -- cgit v1.2.3