Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/utils.rs')
| -rw-r--r-- | crates/hir-ty/src/utils.rs | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/crates/hir-ty/src/utils.rs b/crates/hir-ty/src/utils.rs index 8f36188b78..681d087ede 100644 --- a/crates/hir-ty/src/utils.rs +++ b/crates/hir-ty/src/utils.rs @@ -7,7 +7,7 @@ use base_db::CrateId; use chalk_ir::{ cast::Cast, fold::{FallibleTypeFolder, Shift}, - BoundVar, DebruijnIndex, Mutability, + BoundVar, DebruijnIndex, }; use either::Either; use hir_def::{ @@ -16,7 +16,6 @@ use hir_def::{ GenericParams, TypeOrConstParamData, TypeParamProvenance, WherePredicate, WherePredicateTypeTarget, }, - hir::BindingAnnotation, lang_item::LangItem, resolver::{HasResolver, TypeNs}, type_ref::{TraitBoundModifier, TypeRef}, @@ -35,7 +34,7 @@ use crate::{ layout::{Layout, TagEncoding}, mir::pad16, ChalkTraitId, Const, ConstScalar, GenericArg, Interner, Substitution, TraitRef, TraitRefExt, - Ty, TyExt, WhereClause, + Ty, WhereClause, }; pub(crate) fn fn_traits( @@ -395,23 +394,6 @@ pub fn is_fn_unsafe_to_call(db: &dyn HirDatabase, func: FunctionId) -> bool { } } -pub(crate) fn pattern_matching_dereference_count( - cond_ty: &mut Ty, - binding_mode: &mut BindingAnnotation, -) -> usize { - let mut r = 0; - while let Some((ty, _, mu)) = cond_ty.as_reference() { - if mu == Mutability::Mut && *binding_mode != BindingAnnotation::Ref { - *binding_mode = BindingAnnotation::RefMut; - } else { - *binding_mode = BindingAnnotation::Ref; - } - *cond_ty = ty.clone(); - r += 1; - } - r -} - pub(crate) struct UnevaluatedConstEvaluatorFolder<'a> { pub(crate) db: &'a dyn HirDatabase, } |