diff --git a/crates/mun_codegen/Cargo.toml b/crates/mun_codegen/Cargo.toml index 423a1517a..03d77faf6 100644 --- a/crates/mun_codegen/Cargo.toml +++ b/crates/mun_codegen/Cargo.toml @@ -32,7 +32,7 @@ parking_lot = "0.12.0" inkwell = { version = "=0.1.0-beta.4", features = ["llvm12-0", "no-libffi-linking"]} by_address = "1.0.4" paths = { version="=0.1.0", path="../mun_paths", package="mun_paths"} -smallvec = "1.6.1" +smallvec = { version = "1.6.1", features=["union"] } once_cell = "1.4.0" [dev-dependencies] diff --git a/crates/mun_hir/Cargo.toml b/crates/mun_hir/Cargo.toml index 8712c7a87..067386d4e 100644 --- a/crates/mun_hir/Cargo.toml +++ b/crates/mun_hir/Cargo.toml @@ -23,8 +23,7 @@ ena = "0.14" drop_bomb = "0.1.4" either = "1.5.3" itertools = "0.10.0" -smallvec = "1.6.1" -arrayvec = "0.5.2" +smallvec = { version = "1.6.1", features=["union"] } [dev-dependencies] insta = "1.12.0" diff --git a/crates/mun_hir/src/semantics.rs b/crates/mun_hir/src/semantics.rs index 4988ea924..e3a0a65d8 100644 --- a/crates/mun_hir/src/semantics.rs +++ b/crates/mun_hir/src/semantics.rs @@ -18,9 +18,9 @@ use crate::{ source_analyzer::SourceAnalyzer, FileId, HirDatabase, InFile, ModuleDef, Name, PatId, PerNs, Resolver, Ty, Visibility, }; -use arrayvec::ArrayVec; use mun_syntax::{ast, AstNode, SyntaxNode, TextSize}; use rustc_hash::FxHashMap; +use smallvec::SmallVec; use std::cell::RefCell; /// The primary API to get semantic information, like types, from syntax trees. Exposes the database @@ -162,8 +162,8 @@ pub enum ScopeDef { impl ScopeDef { /// Returns all the `ScopeDef`s from a `PerNs`. Never returns duplicates. - pub fn all_items(def: PerNs<(ItemDefinitionId, Visibility)>) -> ArrayVec<[Self; 2]> { - let mut items = ArrayVec::new(); + pub fn all_items(def: PerNs<(ItemDefinitionId, Visibility)>) -> SmallVec<[Self; 2]> { + let mut items = SmallVec::new(); match (def.take_types(), def.take_values()) { (Some(ty), None) => items.push(ScopeDef::ModuleDef(ty.0.into())), (None, Some(val)) => items.push(ScopeDef::ModuleDef(val.0.into())),