aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-04-07 12:09:31 +0100
committerLukas Wirth <[email protected]>2021-04-07 12:09:31 +0100
commitc3c8e8225ff0a7a741f24777b5ee7a9c3e91eeb7 (patch)
treecb2e469e3a80aaf8dae2f4dbaf3a8bbfb538894f /crates/hir
parente3a5c15d18492f5b9f0c606f988b914918d29ef5 (diff)
Free Ty::def_crates
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index caa22dace..86b36c565 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -53,7 +53,7 @@ use hir_def::{
53use hir_expand::{diagnostics::DiagnosticSink, name::name, MacroDefKind}; 53use hir_expand::{diagnostics::DiagnosticSink, name::name, MacroDefKind};
54use hir_ty::{ 54use hir_ty::{
55 autoderef, could_unify, 55 autoderef, could_unify,
56 method_resolution::{self, TyFingerprint}, 56 method_resolution::{self, def_crates, TyFingerprint},
57 primitive::UintTy, 57 primitive::UintTy,
58 subst_prefix, 58 subst_prefix,
59 traits::FnTrait, 59 traits::FnTrait,
@@ -1568,7 +1568,7 @@ impl Impl {
1568 } 1568 }
1569 1569
1570 pub fn all_for_type(db: &dyn HirDatabase, Type { krate, ty, .. }: Type) -> Vec<Impl> { 1570 pub fn all_for_type(db: &dyn HirDatabase, Type { krate, ty, .. }: Type) -> Vec<Impl> {
1571 let def_crates = match ty.def_crates(db, krate) { 1571 let def_crates = match def_crates(db, &ty, krate) {
1572 Some(def_crates) => def_crates, 1572 Some(def_crates) => def_crates,
1573 None => return Vec::new(), 1573 None => return Vec::new(),
1574 }; 1574 };
@@ -1955,7 +1955,7 @@ impl Type {
1955 krate: Crate, 1955 krate: Crate,
1956 mut callback: impl FnMut(AssocItem) -> Option<T>, 1956 mut callback: impl FnMut(AssocItem) -> Option<T>,
1957 ) -> Option<T> { 1957 ) -> Option<T> {
1958 for krate in self.ty.def_crates(db, krate.id)? { 1958 for krate in def_crates(db, &self.ty, krate.id)? {
1959 let impls = db.inherent_impls_in_crate(krate); 1959 let impls = db.inherent_impls_in_crate(krate);
1960 1960
1961 for impl_def in impls.for_self_ty(&self.ty) { 1961 for impl_def in impls.for_self_ty(&self.ty) {