From 9b5ba090db2c1f913d3f127573ac60c5eb2601bb Mon Sep 17 00:00:00 2001 From: Aramis Razzaghipour Date: Fri, 15 Jan 2021 11:11:07 +1100 Subject: Remove map module from la-arena public API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s unlikely that more items will be added to the module, so it’s simpler for users if `ArenaMap` is re-exported and the module made private. --- crates/hir_def/src/adt.rs | 2 +- crates/hir_def/src/attr.rs | 2 +- crates/hir_def/src/body.rs | 2 +- crates/hir_def/src/db.rs | 2 +- crates/hir_def/src/generics.rs | 2 +- crates/hir_def/src/src.rs | 2 +- crates/hir_def/src/trace.rs | 2 +- crates/hir_ty/src/db.rs | 2 +- crates/hir_ty/src/infer.rs | 2 +- crates/hir_ty/src/lower.rs | 2 +- lib/arena/src/lib.rs | 3 ++- lib/arena/src/map.rs | 2 -- 12 files changed, 12 insertions(+), 13 deletions(-) diff --git a/crates/hir_def/src/adt.rs b/crates/hir_def/src/adt.rs index 237c3d3f9..06f0b9b18 100644 --- a/crates/hir_def/src/adt.rs +++ b/crates/hir_def/src/adt.rs @@ -8,7 +8,7 @@ use hir_expand::{ name::{AsName, Name}, InFile, }; -use la_arena::{map::ArenaMap, Arena}; +use la_arena::{Arena, ArenaMap}; use syntax::ast::{self, NameOwner, VisibilityOwner}; use tt::{Delimiter, DelimiterKind, Leaf, Subtree, TokenTree}; diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index 5a86823c2..1b09ff816 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs @@ -7,7 +7,7 @@ use cfg::{CfgExpr, CfgOptions}; use either::Either; use hir_expand::{hygiene::Hygiene, name::AsName, AstId, InFile}; use itertools::Itertools; -use la_arena::map::ArenaMap; +use la_arena::ArenaMap; use mbe::ast_to_token_tree; use syntax::{ ast::{self, AstNode, AttrsOwner}, diff --git a/crates/hir_def/src/body.rs b/crates/hir_def/src/body.rs index 43ee57277..344f0b6c0 100644 --- a/crates/hir_def/src/body.rs +++ b/crates/hir_def/src/body.rs @@ -16,7 +16,7 @@ use hir_expand::{ ast_id_map::AstIdMap, diagnostics::DiagnosticSink, hygiene::Hygiene, AstId, ExpandResult, HirFileId, InFile, MacroDefId, }; -use la_arena::{map::ArenaMap, Arena}; +use la_arena::{Arena, ArenaMap}; use rustc_hash::FxHashMap; use syntax::{ast, AstNode, AstPtr}; use test_utils::mark; diff --git a/crates/hir_def/src/db.rs b/crates/hir_def/src/db.rs index 0506a7274..6ef9fe790 100644 --- a/crates/hir_def/src/db.rs +++ b/crates/hir_def/src/db.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use base_db::{salsa, CrateId, SourceDatabase, Upcast}; use hir_expand::{db::AstDatabase, HirFileId}; -use la_arena::map::ArenaMap; +use la_arena::ArenaMap; use syntax::SmolStr; use crate::{ diff --git a/crates/hir_def/src/generics.rs b/crates/hir_def/src/generics.rs index 75eab791a..3ace3be1f 100644 --- a/crates/hir_def/src/generics.rs +++ b/crates/hir_def/src/generics.rs @@ -10,7 +10,7 @@ use hir_expand::{ name::{name, AsName, Name}, InFile, }; -use la_arena::{map::ArenaMap, Arena}; +use la_arena::{Arena, ArenaMap}; use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; use crate::{ diff --git a/crates/hir_def/src/src.rs b/crates/hir_def/src/src.rs index eb29265d9..751d4c052 100644 --- a/crates/hir_def/src/src.rs +++ b/crates/hir_def/src/src.rs @@ -1,7 +1,7 @@ //! Utilities for mapping between hir IDs and the surface syntax. use hir_expand::InFile; -use la_arena::map::ArenaMap; +use la_arena::ArenaMap; use crate::{db::DefDatabase, item_tree::ItemTreeNode, AssocItemLoc, ItemLoc}; diff --git a/crates/hir_def/src/trace.rs b/crates/hir_def/src/trace.rs index 0a9beae8e..18d16986b 100644 --- a/crates/hir_def/src/trace.rs +++ b/crates/hir_def/src/trace.rs @@ -9,7 +9,7 @@ //! absolute offsets. The `Trace` structure (inspired, at least in name, by //! Kotlin's `BindingTrace`) allows use the same code to compute both //! projections. -use la_arena::{map::ArenaMap, Arena, Idx, RawId}; +use la_arena::{Arena, ArenaMap, Idx, RawId}; pub(crate) struct Trace { arena: Option>, diff --git a/crates/hir_ty/src/db.rs b/crates/hir_ty/src/db.rs index b0e2a3b7d..b3af82444 100644 --- a/crates/hir_ty/src/db.rs +++ b/crates/hir_ty/src/db.rs @@ -7,7 +7,7 @@ use hir_def::{ db::DefDatabase, expr::ExprId, ConstParamId, DefWithBodyId, FunctionId, GenericDefId, ImplId, LocalFieldId, TypeParamId, VariantId, }; -use la_arena::map::ArenaMap; +use la_arena::ArenaMap; use crate::{ method_resolution::{InherentImpls, TraitImpls}, diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs index 46a806b9a..d08867c70 100644 --- a/crates/hir_ty/src/infer.rs +++ b/crates/hir_ty/src/infer.rs @@ -30,7 +30,7 @@ use hir_def::{ TypeAliasId, VariantId, }; use hir_expand::{diagnostics::DiagnosticSink, name::name}; -use la_arena::map::ArenaMap; +use la_arena::ArenaMap; use rustc_hash::FxHashMap; use stdx::impl_from; use syntax::SmolStr; diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index 68d16f89a..7a734c8b9 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs @@ -20,7 +20,7 @@ use hir_def::{ TypeAliasId, TypeParamId, UnionId, VariantId, }; use hir_expand::name::Name; -use la_arena::map::ArenaMap; +use la_arena::ArenaMap; use smallvec::SmallVec; use stdx::impl_from; use test_utils::mark; diff --git a/lib/arena/src/lib.rs b/lib/arena/src/lib.rs index 3169aa5b8..b15fe941d 100644 --- a/lib/arena/src/lib.rs +++ b/lib/arena/src/lib.rs @@ -8,7 +8,8 @@ use std::{ ops::{Index, IndexMut}, }; -pub mod map; +mod map; +pub use map::ArenaMap; #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct RawId(u32); diff --git a/lib/arena/src/map.rs b/lib/arena/src/map.rs index 0f33907c0..8a8063b7e 100644 --- a/lib/arena/src/map.rs +++ b/lib/arena/src/map.rs @@ -1,5 +1,3 @@ -//! A map from arena IDs to some other type. Space requirement is O(highest ID). - use std::marker::PhantomData; use crate::Idx; -- cgit v1.2.3