aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/Cargo.toml2
-rw-r--r--crates/hir/src/lib.rs8
-rw-r--r--crates/hir/src/semantics.rs2
3 files changed, 8 insertions, 4 deletions
diff --git a/crates/hir/Cargo.toml b/crates/hir/Cargo.toml
index 55e9c3f0c..2ef5bcbc9 100644
--- a/crates/hir/Cargo.toml
+++ b/crates/hir/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
13log = "0.4.8" 13log = "0.4.8"
14rustc-hash = "1.1.0" 14rustc-hash = "1.1.0"
15either = "1.5.3" 15either = "1.5.3"
16arrayvec = "0.5.1" 16arrayvec = "0.6"
17itertools = "0.10.0" 17itertools = "0.10.0"
18smallvec = "1.4.0" 18smallvec = "1.4.0"
19 19
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 6fa676c4d..4ee08ef21 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -51,7 +51,7 @@ use hir_def::{
51}; 51};
52use hir_expand::{diagnostics::DiagnosticSink, name::name, MacroDefKind}; 52use hir_expand::{diagnostics::DiagnosticSink, name::name, MacroDefKind};
53use hir_ty::{ 53use hir_ty::{
54 autoderef, 54 autoderef, could_unify,
55 method_resolution::{self, TyFingerprint}, 55 method_resolution::{self, TyFingerprint},
56 primitive::UintTy, 56 primitive::UintTy,
57 to_assoc_type_id, 57 to_assoc_type_id,
@@ -2154,6 +2154,10 @@ impl Type {
2154 2154
2155 walk_type(db, self, &mut cb); 2155 walk_type(db, self, &mut cb);
2156 } 2156 }
2157
2158 pub fn could_unify_with(&self, other: &Type) -> bool {
2159 could_unify(&self.ty, &other.ty)
2160 }
2157} 2161}
2158 2162
2159// FIXME: closures 2163// FIXME: closures
@@ -2238,7 +2242,7 @@ pub enum ScopeDef {
2238} 2242}
2239 2243
2240impl ScopeDef { 2244impl ScopeDef {
2241 pub fn all_items(def: PerNs) -> ArrayVec<[Self; 3]> { 2245 pub fn all_items(def: PerNs) -> ArrayVec<Self, 3> {
2242 let mut items = ArrayVec::new(); 2246 let mut items = ArrayVec::new();
2243 2247
2244 match (def.take_types(), def.take_values()) { 2248 match (def.take_types(), def.take_values()) {
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs
index 1198e3f0b..3ff135f41 100644
--- a/crates/hir/src/semantics.rs
+++ b/crates/hir/src/semantics.rs
@@ -445,7 +445,7 @@ impl<'db> SemanticsImpl<'db> {
445 } 445 }
446 }; 446 };
447 gpl.lifetime_params() 447 gpl.lifetime_params()
448 .find(|tp| tp.lifetime().as_ref().map(|lt| lt.text()) == Some(text)) 448 .find(|tp| tp.lifetime().as_ref().map(|lt| lt.text()).as_ref() == Some(&text))
449 })?; 449 })?;
450 let src = self.find_file(lifetime_param.syntax().clone()).with_value(lifetime_param); 450 let src = self.find_file(lifetime_param.syntax().clone()).with_value(lifetime_param);
451 ToDef::to_def(self, src) 451 ToDef::to_def(self, src)