diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-17 07:20:36 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-17 07:20:36 +0000 |
commit | 3224ecea8734f850eda474c136ae4dcb7e1aa3f1 (patch) | |
tree | 0405cf7c9b9787a5be19d226fc7875d389bda15b | |
parent | f5f011ba714589d65b7dae398938242abcbc3fee (diff) | |
parent | 9b5ba090db2c1f913d3f127573ac60c5eb2601bb (diff) |
Merge #7276
7276: Remove map module from la-arena public API r=lnicola a=arzg
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.
This doesn’t compile for the same reason that #7275 doesn’t:
> This pull request doesn’t compile because dependencies on la-arena go through crates.io, so existing dependencies on the crate are referencing an old version. As such, this PR will only compile once a new la-arena version has been published.
Co-authored-by: Aramis Razzaghipour <[email protected]>
-rw-r--r-- | crates/hir_def/src/adt.rs | 2 | ||||
-rw-r--r-- | crates/hir_def/src/attr.rs | 2 | ||||
-rw-r--r-- | crates/hir_def/src/body.rs | 2 | ||||
-rw-r--r-- | crates/hir_def/src/db.rs | 2 | ||||
-rw-r--r-- | crates/hir_def/src/generics.rs | 2 | ||||
-rw-r--r-- | crates/hir_def/src/src.rs | 2 | ||||
-rw-r--r-- | crates/hir_def/src/trace.rs | 2 | ||||
-rw-r--r-- | crates/hir_ty/src/db.rs | 2 | ||||
-rw-r--r-- | crates/hir_ty/src/infer.rs | 2 | ||||
-rw-r--r-- | crates/hir_ty/src/lower.rs | 2 | ||||
-rw-r--r-- | lib/arena/src/lib.rs | 3 | ||||
-rw-r--r-- | 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::{ | |||
8 | name::{AsName, Name}, | 8 | name::{AsName, Name}, |
9 | InFile, | 9 | InFile, |
10 | }; | 10 | }; |
11 | use la_arena::{map::ArenaMap, Arena}; | 11 | use la_arena::{Arena, ArenaMap}; |
12 | use syntax::ast::{self, NameOwner, VisibilityOwner}; | 12 | use syntax::ast::{self, NameOwner, VisibilityOwner}; |
13 | use tt::{Delimiter, DelimiterKind, Leaf, Subtree, TokenTree}; | 13 | use tt::{Delimiter, DelimiterKind, Leaf, Subtree, TokenTree}; |
14 | 14 | ||
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}; | |||
7 | use either::Either; | 7 | use either::Either; |
8 | use hir_expand::{hygiene::Hygiene, name::AsName, AstId, InFile}; | 8 | use hir_expand::{hygiene::Hygiene, name::AsName, AstId, InFile}; |
9 | use itertools::Itertools; | 9 | use itertools::Itertools; |
10 | use la_arena::map::ArenaMap; | 10 | use la_arena::ArenaMap; |
11 | use mbe::ast_to_token_tree; | 11 | use mbe::ast_to_token_tree; |
12 | use syntax::{ | 12 | use syntax::{ |
13 | ast::{self, AstNode, AttrsOwner}, | 13 | 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::{ | |||
16 | ast_id_map::AstIdMap, diagnostics::DiagnosticSink, hygiene::Hygiene, AstId, ExpandResult, | 16 | ast_id_map::AstIdMap, diagnostics::DiagnosticSink, hygiene::Hygiene, AstId, ExpandResult, |
17 | HirFileId, InFile, MacroDefId, | 17 | HirFileId, InFile, MacroDefId, |
18 | }; | 18 | }; |
19 | use la_arena::{map::ArenaMap, Arena}; | 19 | use la_arena::{Arena, ArenaMap}; |
20 | use rustc_hash::FxHashMap; | 20 | use rustc_hash::FxHashMap; |
21 | use syntax::{ast, AstNode, AstPtr}; | 21 | use syntax::{ast, AstNode, AstPtr}; |
22 | use test_utils::mark; | 22 | 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; | |||
3 | 3 | ||
4 | use base_db::{salsa, CrateId, SourceDatabase, Upcast}; | 4 | use base_db::{salsa, CrateId, SourceDatabase, Upcast}; |
5 | use hir_expand::{db::AstDatabase, HirFileId}; | 5 | use hir_expand::{db::AstDatabase, HirFileId}; |
6 | use la_arena::map::ArenaMap; | 6 | use la_arena::ArenaMap; |
7 | use syntax::SmolStr; | 7 | use syntax::SmolStr; |
8 | 8 | ||
9 | use crate::{ | 9 | 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::{ | |||
10 | name::{name, AsName, Name}, | 10 | name::{name, AsName, Name}, |
11 | InFile, | 11 | InFile, |
12 | }; | 12 | }; |
13 | use la_arena::{map::ArenaMap, Arena}; | 13 | use la_arena::{Arena, ArenaMap}; |
14 | use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; | 14 | use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; |
15 | 15 | ||
16 | use crate::{ | 16 | 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 @@ | |||
1 | //! Utilities for mapping between hir IDs and the surface syntax. | 1 | //! Utilities for mapping between hir IDs and the surface syntax. |
2 | 2 | ||
3 | use hir_expand::InFile; | 3 | use hir_expand::InFile; |
4 | use la_arena::map::ArenaMap; | 4 | use la_arena::ArenaMap; |
5 | 5 | ||
6 | use crate::{db::DefDatabase, item_tree::ItemTreeNode, AssocItemLoc, ItemLoc}; | 6 | use crate::{db::DefDatabase, item_tree::ItemTreeNode, AssocItemLoc, ItemLoc}; |
7 | 7 | ||
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 @@ | |||
9 | //! absolute offsets. The `Trace` structure (inspired, at least in name, by | 9 | //! absolute offsets. The `Trace` structure (inspired, at least in name, by |
10 | //! Kotlin's `BindingTrace`) allows use the same code to compute both | 10 | //! Kotlin's `BindingTrace`) allows use the same code to compute both |
11 | //! projections. | 11 | //! projections. |
12 | use la_arena::{map::ArenaMap, Arena, Idx, RawId}; | 12 | use la_arena::{Arena, ArenaMap, Idx, RawId}; |
13 | 13 | ||
14 | pub(crate) struct Trace<T, V> { | 14 | pub(crate) struct Trace<T, V> { |
15 | arena: Option<Arena<T>>, | 15 | arena: Option<Arena<T>>, |
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::{ | |||
7 | db::DefDatabase, expr::ExprId, ConstParamId, DefWithBodyId, FunctionId, GenericDefId, ImplId, | 7 | db::DefDatabase, expr::ExprId, ConstParamId, DefWithBodyId, FunctionId, GenericDefId, ImplId, |
8 | LocalFieldId, TypeParamId, VariantId, | 8 | LocalFieldId, TypeParamId, VariantId, |
9 | }; | 9 | }; |
10 | use la_arena::map::ArenaMap; | 10 | use la_arena::ArenaMap; |
11 | 11 | ||
12 | use crate::{ | 12 | use crate::{ |
13 | method_resolution::{InherentImpls, TraitImpls}, | 13 | 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::{ | |||
30 | TypeAliasId, VariantId, | 30 | TypeAliasId, VariantId, |
31 | }; | 31 | }; |
32 | use hir_expand::{diagnostics::DiagnosticSink, name::name}; | 32 | use hir_expand::{diagnostics::DiagnosticSink, name::name}; |
33 | use la_arena::map::ArenaMap; | 33 | use la_arena::ArenaMap; |
34 | use rustc_hash::FxHashMap; | 34 | use rustc_hash::FxHashMap; |
35 | use stdx::impl_from; | 35 | use stdx::impl_from; |
36 | use syntax::SmolStr; | 36 | 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::{ | |||
20 | TypeAliasId, TypeParamId, UnionId, VariantId, | 20 | TypeAliasId, TypeParamId, UnionId, VariantId, |
21 | }; | 21 | }; |
22 | use hir_expand::name::Name; | 22 | use hir_expand::name::Name; |
23 | use la_arena::map::ArenaMap; | 23 | use la_arena::ArenaMap; |
24 | use smallvec::SmallVec; | 24 | use smallvec::SmallVec; |
25 | use stdx::impl_from; | 25 | use stdx::impl_from; |
26 | use test_utils::mark; | 26 | use test_utils::mark; |
diff --git a/lib/arena/src/lib.rs b/lib/arena/src/lib.rs index 78a147c7d..1de3a1d2f 100644 --- a/lib/arena/src/lib.rs +++ b/lib/arena/src/lib.rs | |||
@@ -10,7 +10,8 @@ use std::{ | |||
10 | ops::{Index, IndexMut}, | 10 | ops::{Index, IndexMut}, |
11 | }; | 11 | }; |
12 | 12 | ||
13 | pub mod map; | 13 | mod map; |
14 | pub use map::ArenaMap; | ||
14 | 15 | ||
15 | /// The raw ID of a value in an arena. | 16 | /// The raw ID of a value in an arena. |
16 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | 17 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] |
diff --git a/lib/arena/src/map.rs b/lib/arena/src/map.rs index 980198247..5ebaa9b82 100644 --- a/lib/arena/src/map.rs +++ b/lib/arena/src/map.rs | |||
@@ -1,5 +1,3 @@ | |||
1 | //! A map from arena IDs to some other type. Space requirement is O(highest ID). | ||
2 | |||
3 | use std::marker::PhantomData; | 1 | use std::marker::PhantomData; |
4 | 2 | ||
5 | use crate::Idx; | 3 | use crate::Idx; |