mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 04:18:20 +00:00
Merge pull request #19049 from ChayimFriedman2/add-reference-ty
minor: Remove duplicate method from `hir::Type`
This commit is contained in:
commit
8384bc5c55
4 changed files with 5 additions and 16 deletions
|
|
@ -4730,17 +4730,6 @@ impl Type {
|
|||
Type { env: TraitEnvironment::empty(krate), ty }
|
||||
}
|
||||
|
||||
pub fn reference(inner: &Type, m: Mutability) -> Type {
|
||||
inner.derived(
|
||||
TyKind::Ref(
|
||||
if m.is_mut() { hir_ty::Mutability::Mut } else { hir_ty::Mutability::Not },
|
||||
hir_ty::error_lifetime(),
|
||||
inner.ty.clone(),
|
||||
)
|
||||
.intern(Interner),
|
||||
)
|
||||
}
|
||||
|
||||
fn new(db: &dyn HirDatabase, lexical_env: impl HasResolver, ty: Ty) -> Type {
|
||||
let resolver = lexical_env.resolver(db.upcast());
|
||||
let environment = resolver
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ impl LookupTable {
|
|||
self.data
|
||||
.iter()
|
||||
.find(|(t, _)| {
|
||||
Type::reference(t, Mutability::Shared).could_unify_with_deeply(db, ty)
|
||||
t.add_reference(Mutability::Shared).could_unify_with_deeply(db, ty)
|
||||
})
|
||||
.map(|(t, it)| {
|
||||
it.exprs(t)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue