From d992736e796501b2a5ae232644924a3dfefede92 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 8 Apr 2021 14:35:15 +0200 Subject: Remove unused --- crates/hir_ty/src/utils.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'crates/hir_ty/src/utils.rs') diff --git a/crates/hir_ty/src/utils.rs b/crates/hir_ty/src/utils.rs index d26f5152c..5f6cb052a 100644 --- a/crates/hir_ty/src/utils.rs +++ b/crates/hir_ty/src/utils.rs @@ -1,6 +1,5 @@ //! Helper functions for working with def, which don't need to be a separate //! query, but can't be computed directly from `*Data` (ie, which need a `db`). -use std::sync::Arc; use chalk_ir::{fold::Shift, BoundVar, DebruijnIndex}; use hir_def::{ @@ -16,9 +15,7 @@ use hir_def::{ }; use hir_expand::name::{name, Name}; -use crate::{ - db::HirDatabase, Interner, Substitution, TraitRef, TraitRefExt, TyKind, TypeWalk, WhereClause, -}; +use crate::{db::HirDatabase, Interner, Substitution, TraitRef, TraitRefExt, TyKind, WhereClause}; fn direct_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> Vec { let resolver = trait_.resolver(db); @@ -137,15 +134,6 @@ pub(super) fn associated_type_by_name_including_super_traits( }) } -/// Helper for mutating `Arc<[T]>` (i.e. `Arc::make_mut` for Arc slices). -/// The underlying values are cloned if there are other strong references. -pub(crate) fn make_mut_slice(a: &mut Arc<[T]>) -> &mut [T] { - if Arc::get_mut(a).is_none() { - *a = a.iter().cloned().collect(); - } - Arc::get_mut(a).unwrap() -} - pub(crate) fn generics(db: &dyn DefDatabase, def: GenericDefId) -> Generics { let parent_generics = parent_generic_def(db, def).map(|def| Box::new(generics(db, def))); Generics { def, params: db.generic_params(def), parent_generics } -- cgit v1.2.3