aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty')
-rw-r--r--crates/hir_ty/Cargo.toml2
-rw-r--r--crates/hir_ty/src/display.rs6
-rw-r--r--crates/hir_ty/src/method_resolution.rs4
3 files changed, 5 insertions, 7 deletions
diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml
index 0ef27cd37..030b7eebe 100644
--- a/crates/hir_ty/Cargo.toml
+++ b/crates/hir_ty/Cargo.toml
@@ -12,7 +12,7 @@ doctest = false
12[dependencies] 12[dependencies]
13cov-mark = { version = "1.1", features = ["thread-local"] } 13cov-mark = { version = "1.1", features = ["thread-local"] }
14itertools = "0.10.0" 14itertools = "0.10.0"
15arrayvec = "0.5.1" 15arrayvec = "0.6"
16smallvec = "1.2.0" 16smallvec = "1.2.0"
17ena = "0.14.0" 17ena = "0.14.0"
18log = "0.4.8" 18log = "0.4.8"
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs
index 6149067c7..51480304b 100644
--- a/crates/hir_ty/src/display.rs
+++ b/crates/hir_ty/src/display.rs
@@ -1,8 +1,7 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use std::fmt; 3use std::{array, fmt};
4 4
5use arrayvec::ArrayVec;
6use chalk_ir::Mutability; 5use chalk_ir::Mutability;
7use hir_def::{ 6use hir_def::{
8 db::DefDatabase, 7 db::DefDatabase,
@@ -669,8 +668,7 @@ fn fn_traits(db: &dyn DefDatabase, trait_: TraitId) -> impl Iterator<Item = Trai
669 db.lang_item(krate, "fn_mut".into()), 668 db.lang_item(krate, "fn_mut".into()),
670 db.lang_item(krate, "fn_once".into()), 669 db.lang_item(krate, "fn_once".into()),
671 ]; 670 ];
672 // FIXME: Replace ArrayVec when into_iter is a thing on arrays 671 array::IntoIter::new(fn_traits).into_iter().flatten().flat_map(|it| it.as_trait())
673 ArrayVec::from(fn_traits).into_iter().flatten().flat_map(|it| it.as_trait())
674} 672}
675 673
676pub fn write_bounds_like_dyn_trait_with_prefix( 674pub fn write_bounds_like_dyn_trait_with_prefix(
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs
index 84d9a1e18..bf7d5eded 100644
--- a/crates/hir_ty/src/method_resolution.rs
+++ b/crates/hir_ty/src/method_resolution.rs
@@ -228,12 +228,12 @@ impl Ty {
228 &self, 228 &self,
229 db: &dyn HirDatabase, 229 db: &dyn HirDatabase,
230 cur_crate: CrateId, 230 cur_crate: CrateId,
231 ) -> Option<ArrayVec<[CrateId; 2]>> { 231 ) -> Option<ArrayVec<CrateId, 2>> {
232 // Types like slice can have inherent impls in several crates, (core and alloc). 232 // Types like slice can have inherent impls in several crates, (core and alloc).
233 // The corresponding impls are marked with lang items, so we can use them to find the required crates. 233 // The corresponding impls are marked with lang items, so we can use them to find the required crates.
234 macro_rules! lang_item_crate { 234 macro_rules! lang_item_crate {
235 ($($name:expr),+ $(,)?) => {{ 235 ($($name:expr),+ $(,)?) => {{
236 let mut v = ArrayVec::<[LangItemTarget; 2]>::new(); 236 let mut v = ArrayVec::<LangItemTarget, 2>::new();
237 $( 237 $(
238 v.extend(db.lang_item(cur_crate, $name.into())); 238 v.extend(db.lang_item(cur_crate, $name.into()));
239 )+ 239 )+