aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-25 19:09:13 +0000
committerGitHub <[email protected]>2021-03-25 19:09:13 +0000
commit4cb3ecce3ff2573c8473733b2538b32cd899b686 (patch)
treeb4c30f7eacbe0dd03bebafc534c7a8bdbfee7aa6 /crates/hir_ty/src
parent59fdd7c84c5fdc16573f3cca4081d6735eaa9208 (diff)
parentbc5c86543b1bf384555471415dee770888a1781d (diff)
Merge #8200
8200: Use arrayvec 0.6 r=kjeremy a=lnicola Closes #8198 changelog skip Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r--crates/hir_ty/src/display.rs6
-rw-r--r--crates/hir_ty/src/method_resolution.rs4
2 files changed, 4 insertions, 6 deletions
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 )+