Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/mun_codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 1 addition & 2 deletions crates/mun_hir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions crates/mun_hir/src/semantics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())),
Expand Down