aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-14 16:06:30 +0000
committerGitHub <[email protected]>2021-01-14 16:06:30 +0000
commitf88f3d688507508ae9528101e13e1c62902467a3 (patch)
tree325af14ad9cd20312fb6166f1c06f3cb39684fe3
parent540edee3cd11d45a03abc072bb9b6f01b59bcb25 (diff)
parent4c4e54ac8a9782439744fe15aa31a3bedab92b74 (diff)
Merge #7271
7271: prepare to publish el libro de arena r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--Cargo.lock24
-rw-r--r--Cargo.toml2
-rw-r--r--crates/hir_def/Cargo.toml2
-rw-r--r--crates/hir_def/src/adt.rs2
-rw-r--r--crates/hir_def/src/attr.rs2
-rw-r--r--crates/hir_def/src/body.rs2
-rw-r--r--crates/hir_def/src/body/lower.rs2
-rw-r--r--crates/hir_def/src/body/scope.rs2
-rw-r--r--crates/hir_def/src/db.rs2
-rw-r--r--crates/hir_def/src/expr.rs2
-rw-r--r--crates/hir_def/src/generics.rs2
-rw-r--r--crates/hir_def/src/item_tree.rs2
-rw-r--r--crates/hir_def/src/lib.rs2
-rw-r--r--crates/hir_def/src/nameres.rs2
-rw-r--r--crates/hir_def/src/nameres/collector.rs2
-rw-r--r--crates/hir_def/src/src.rs2
-rw-r--r--crates/hir_def/src/trace.rs2
-rw-r--r--crates/hir_expand/Cargo.toml2
-rw-r--r--crates/hir_expand/src/ast_id_map.rs2
-rw-r--r--crates/hir_ty/Cargo.toml2
-rw-r--r--crates/hir_ty/src/db.rs2
-rw-r--r--crates/hir_ty/src/diagnostics/match_check.rs2
-rw-r--r--crates/hir_ty/src/infer.rs2
-rw-r--r--crates/hir_ty/src/lower.rs2
-rw-r--r--crates/profile/Cargo.toml3
-rw-r--r--crates/profile/src/tree.rs4
-rw-r--r--crates/project_model/Cargo.toml2
-rw-r--r--crates/project_model/src/cargo_workspace.rs2
-rw-r--r--crates/project_model/src/sysroot.rs2
-rw-r--r--lib/README.md2
-rw-r--r--lib/arena/Cargo.toml (renamed from crates/arena/Cargo.toml)6
-rw-r--r--lib/arena/src/lib.rs (renamed from crates/arena/src/lib.rs)0
-rw-r--r--lib/arena/src/map.rs (renamed from crates/arena/src/map.rs)0
33 files changed, 49 insertions, 42 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ae99b966e..c715e5e0b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -37,10 +37,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
37checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" 37checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344"
38 38
39[[package]] 39[[package]]
40name = "arena"
41version = "0.0.0"
42
43[[package]]
44name = "arrayvec" 40name = "arrayvec"
45version = "0.5.2" 41version = "0.5.2"
46source = "registry+https://github.com/rust-lang/crates.io-index" 42source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -547,7 +543,6 @@ name = "hir_def"
547version = "0.0.0" 543version = "0.0.0"
548dependencies = [ 544dependencies = [
549 "anymap", 545 "anymap",
550 "arena",
551 "base_db", 546 "base_db",
552 "cfg", 547 "cfg",
553 "drop_bomb", 548 "drop_bomb",
@@ -557,6 +552,7 @@ dependencies = [
557 "hir_expand", 552 "hir_expand",
558 "indexmap", 553 "indexmap",
559 "itertools 0.10.0", 554 "itertools 0.10.0",
555 "la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
560 "log", 556 "log",
561 "mbe", 557 "mbe",
562 "once_cell", 558 "once_cell",
@@ -573,9 +569,9 @@ dependencies = [
573name = "hir_expand" 569name = "hir_expand"
574version = "0.0.0" 570version = "0.0.0"
575dependencies = [ 571dependencies = [
576 "arena",
577 "base_db", 572 "base_db",
578 "either", 573 "either",
574 "la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
579 "log", 575 "log",
580 "mbe", 576 "mbe",
581 "parser", 577 "parser",
@@ -590,7 +586,6 @@ dependencies = [
590name = "hir_ty" 586name = "hir_ty"
591version = "0.0.0" 587version = "0.0.0"
592dependencies = [ 588dependencies = [
593 "arena",
594 "arrayvec", 589 "arrayvec",
595 "base_db", 590 "base_db",
596 "chalk-ir", 591 "chalk-ir",
@@ -601,6 +596,7 @@ dependencies = [
601 "hir_def", 596 "hir_def",
602 "hir_expand", 597 "hir_expand",
603 "itertools 0.10.0", 598 "itertools 0.10.0",
599 "la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
604 "log", 600 "log",
605 "once_cell", 601 "once_cell",
606 "profile", 602 "profile",
@@ -772,6 +768,16 @@ dependencies = [
772] 768]
773 769
774[[package]] 770[[package]]
771name = "la-arena"
772version = "0.1.0"
773
774[[package]]
775name = "la-arena"
776version = "0.1.0"
777source = "registry+https://github.com/rust-lang/crates.io-index"
778checksum = "b0385ab3b926cc05c78275d7ac6799c21fb964ada0a45cdaeaf1415d6a3dda39"
779
780[[package]]
775name = "lazy_static" 781name = "lazy_static"
776version = "1.4.0" 782version = "1.4.0"
777source = "registry+https://github.com/rust-lang/crates.io-index" 783source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1196,8 +1202,8 @@ version = "0.0.0"
1196name = "profile" 1202name = "profile"
1197version = "0.0.0" 1203version = "0.0.0"
1198dependencies = [ 1204dependencies = [
1199 "arena",
1200 "cfg-if 1.0.0", 1205 "cfg-if 1.0.0",
1206 "la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
1201 "libc", 1207 "libc",
1202 "once_cell", 1208 "once_cell",
1203 "perf-event", 1209 "perf-event",
@@ -1208,11 +1214,11 @@ name = "project_model"
1208version = "0.0.0" 1214version = "0.0.0"
1209dependencies = [ 1215dependencies = [
1210 "anyhow", 1216 "anyhow",
1211 "arena",
1212 "base_db", 1217 "base_db",
1213 "cargo_metadata", 1218 "cargo_metadata",
1214 "cfg", 1219 "cfg",
1215 "itertools 0.10.0", 1220 "itertools 0.10.0",
1221 "la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
1216 "log", 1222 "log",
1217 "paths", 1223 "paths",
1218 "proc_macro_api", 1224 "proc_macro_api",
diff --git a/Cargo.toml b/Cargo.toml
index 59d36fbc1..ff0d9e1ce 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,5 @@
1[workspace] 1[workspace]
2members = [ "crates/*", "xtask/" ] 2members = [ "xtask/", "lib/*", "crates/*" ]
3 3
4[profile.dev] 4[profile.dev]
5# Disabling debug info speeds up builds a bunch, 5# Disabling debug info speeds up builds a bunch,
diff --git a/crates/hir_def/Cargo.toml b/crates/hir_def/Cargo.toml
index 7ef966cd2..5d21283f7 100644
--- a/crates/hir_def/Cargo.toml
+++ b/crates/hir_def/Cargo.toml
@@ -20,9 +20,9 @@ fst = { version = "0.4", default-features = false }
20itertools = "0.10.0" 20itertools = "0.10.0"
21indexmap = "1.4.0" 21indexmap = "1.4.0"
22smallvec = "1.4.0" 22smallvec = "1.4.0"
23la-arena = "0.1.0"
23 24
24stdx = { path = "../stdx", version = "0.0.0" } 25stdx = { path = "../stdx", version = "0.0.0" }
25arena = { path = "../arena", version = "0.0.0" }
26base_db = { path = "../base_db", version = "0.0.0" } 26base_db = { path = "../base_db", version = "0.0.0" }
27syntax = { path = "../syntax", version = "0.0.0" } 27syntax = { path = "../syntax", version = "0.0.0" }
28profile = { path = "../profile", version = "0.0.0" } 28profile = { path = "../profile", version = "0.0.0" }
diff --git a/crates/hir_def/src/adt.rs b/crates/hir_def/src/adt.rs
index 236d6f1b7..237c3d3f9 100644
--- a/crates/hir_def/src/adt.rs
+++ b/crates/hir_def/src/adt.rs
@@ -2,13 +2,13 @@
2 2
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use arena::{map::ArenaMap, Arena};
6use base_db::CrateId; 5use base_db::CrateId;
7use either::Either; 6use either::Either;
8use hir_expand::{ 7use hir_expand::{
9 name::{AsName, Name}, 8 name::{AsName, Name},
10 InFile, 9 InFile,
11}; 10};
11use la_arena::{map::ArenaMap, Arena};
12use syntax::ast::{self, NameOwner, VisibilityOwner}; 12use syntax::ast::{self, NameOwner, VisibilityOwner};
13use tt::{Delimiter, DelimiterKind, Leaf, Subtree, TokenTree}; 13use 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 9e6426b31..5a86823c2 100644
--- a/crates/hir_def/src/attr.rs
+++ b/crates/hir_def/src/attr.rs
@@ -2,12 +2,12 @@
2 2
3use std::{ops, sync::Arc}; 3use std::{ops, sync::Arc};
4 4
5use arena::map::ArenaMap;
6use base_db::CrateId; 5use base_db::CrateId;
7use cfg::{CfgExpr, CfgOptions}; 6use cfg::{CfgExpr, CfgOptions};
8use either::Either; 7use either::Either;
9use hir_expand::{hygiene::Hygiene, name::AsName, AstId, InFile}; 8use hir_expand::{hygiene::Hygiene, name::AsName, AstId, InFile};
10use itertools::Itertools; 9use itertools::Itertools;
10use la_arena::map::ArenaMap;
11use mbe::ast_to_token_tree; 11use mbe::ast_to_token_tree;
12use syntax::{ 12use 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 d07004b9d..43ee57277 100644
--- a/crates/hir_def/src/body.rs
+++ b/crates/hir_def/src/body.rs
@@ -8,7 +8,6 @@ pub mod scope;
8 8
9use std::{mem, ops::Index, sync::Arc}; 9use std::{mem, ops::Index, sync::Arc};
10 10
11use arena::{map::ArenaMap, Arena};
12use base_db::CrateId; 11use base_db::CrateId;
13use cfg::CfgOptions; 12use cfg::CfgOptions;
14use drop_bomb::DropBomb; 13use drop_bomb::DropBomb;
@@ -17,6 +16,7 @@ use hir_expand::{
17 ast_id_map::AstIdMap, diagnostics::DiagnosticSink, hygiene::Hygiene, AstId, ExpandResult, 16 ast_id_map::AstIdMap, diagnostics::DiagnosticSink, hygiene::Hygiene, AstId, ExpandResult,
18 HirFileId, InFile, MacroDefId, 17 HirFileId, InFile, MacroDefId,
19}; 18};
19use la_arena::{map::ArenaMap, Arena};
20use rustc_hash::FxHashMap; 20use rustc_hash::FxHashMap;
21use syntax::{ast, AstNode, AstPtr}; 21use syntax::{ast, AstNode, AstPtr};
22use test_utils::mark; 22use test_utils::mark;
diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs
index 3dc33f248..27575c537 100644
--- a/crates/hir_def/src/body/lower.rs
+++ b/crates/hir_def/src/body/lower.rs
@@ -3,13 +3,13 @@
3 3
4use std::{any::type_name, sync::Arc}; 4use std::{any::type_name, sync::Arc};
5 5
6use arena::Arena;
7use either::Either; 6use either::Either;
8use hir_expand::{ 7use hir_expand::{
9 hygiene::Hygiene, 8 hygiene::Hygiene,
10 name::{name, AsName, Name}, 9 name::{name, AsName, Name},
11 ExpandError, HirFileId, MacroDefId, MacroDefKind, 10 ExpandError, HirFileId, MacroDefId, MacroDefKind,
12}; 11};
12use la_arena::Arena;
13use rustc_hash::FxHashMap; 13use rustc_hash::FxHashMap;
14use syntax::{ 14use syntax::{
15 ast::{ 15 ast::{
diff --git a/crates/hir_def/src/body/scope.rs b/crates/hir_def/src/body/scope.rs
index 065785da7..49f1427b4 100644
--- a/crates/hir_def/src/body/scope.rs
+++ b/crates/hir_def/src/body/scope.rs
@@ -1,8 +1,8 @@
1//! Name resolution for expressions. 1//! Name resolution for expressions.
2use std::sync::Arc; 2use std::sync::Arc;
3 3
4use arena::{Arena, Idx};
5use hir_expand::name::Name; 4use hir_expand::name::Name;
5use la_arena::{Arena, Idx};
6use rustc_hash::FxHashMap; 6use rustc_hash::FxHashMap;
7 7
8use crate::{ 8use crate::{
diff --git a/crates/hir_def/src/db.rs b/crates/hir_def/src/db.rs
index d3bf5b34c..0506a7274 100644
--- a/crates/hir_def/src/db.rs
+++ b/crates/hir_def/src/db.rs
@@ -1,9 +1,9 @@
1//! Defines database & queries for name resolution. 1//! Defines database & queries for name resolution.
2use std::sync::Arc; 2use std::sync::Arc;
3 3
4use arena::map::ArenaMap;
5use base_db::{salsa, CrateId, SourceDatabase, Upcast}; 4use base_db::{salsa, CrateId, SourceDatabase, Upcast};
6use hir_expand::{db::AstDatabase, HirFileId}; 5use hir_expand::{db::AstDatabase, HirFileId};
6use la_arena::map::ArenaMap;
7use syntax::SmolStr; 7use syntax::SmolStr;
8 8
9use crate::{ 9use crate::{
diff --git a/crates/hir_def/src/expr.rs b/crates/hir_def/src/expr.rs
index 76f5721e5..af01d32dc 100644
--- a/crates/hir_def/src/expr.rs
+++ b/crates/hir_def/src/expr.rs
@@ -12,8 +12,8 @@
12//! 12//!
13//! See also a neighboring `body` module. 13//! See also a neighboring `body` module.
14 14
15use arena::{Idx, RawId};
16use hir_expand::name::Name; 15use hir_expand::name::Name;
16use la_arena::{Idx, RawId};
17use syntax::ast::RangeOp; 17use syntax::ast::RangeOp;
18 18
19use crate::{ 19use crate::{
diff --git a/crates/hir_def/src/generics.rs b/crates/hir_def/src/generics.rs
index 9b5b886c2..75eab791a 100644
--- a/crates/hir_def/src/generics.rs
+++ b/crates/hir_def/src/generics.rs
@@ -4,13 +4,13 @@
4//! in rustc. 4//! in rustc.
5use std::sync::Arc; 5use std::sync::Arc;
6 6
7use arena::{map::ArenaMap, Arena};
8use base_db::FileId; 7use base_db::FileId;
9use either::Either; 8use either::Either;
10use hir_expand::{ 9use hir_expand::{
11 name::{name, AsName, Name}, 10 name::{name, AsName, Name},
12 InFile, 11 InFile,
13}; 12};
13use la_arena::{map::ArenaMap, Arena};
14use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; 14use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner};
15 15
16use crate::{ 16use crate::{
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index b6f510731..91e42aa0d 100644
--- a/crates/hir_def/src/item_tree.rs
+++ b/crates/hir_def/src/item_tree.rs
@@ -11,7 +11,6 @@ use std::{
11 sync::Arc, 11 sync::Arc,
12}; 12};
13 13
14use arena::{Arena, Idx, RawId};
15use ast::{AstNode, NameOwner, StructKind}; 14use ast::{AstNode, NameOwner, StructKind};
16use base_db::CrateId; 15use base_db::CrateId;
17use either::Either; 16use either::Either;
@@ -21,6 +20,7 @@ use hir_expand::{
21 name::{name, AsName, Name}, 20 name::{name, AsName, Name},
22 HirFileId, InFile, 21 HirFileId, InFile,
23}; 22};
23use la_arena::{Arena, Idx, RawId};
24use rustc_hash::FxHashMap; 24use rustc_hash::FxHashMap;
25use smallvec::SmallVec; 25use smallvec::SmallVec;
26use syntax::{ast, match_ast}; 26use syntax::{ast, match_ast};
diff --git a/crates/hir_def/src/lib.rs b/crates/hir_def/src/lib.rs
index 211cb2faf..08ed920c6 100644
--- a/crates/hir_def/src/lib.rs
+++ b/crates/hir_def/src/lib.rs
@@ -52,12 +52,12 @@ mod test_db;
52 52
53use std::hash::{Hash, Hasher}; 53use std::hash::{Hash, Hasher};
54 54
55use arena::Idx;
56use base_db::{impl_intern_key, salsa, CrateId}; 55use base_db::{impl_intern_key, salsa, CrateId};
57use hir_expand::{ 56use hir_expand::{
58 ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile, 57 ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile,
59 MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, 58 MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
60}; 59};
60use la_arena::Idx;
61use syntax::ast; 61use syntax::ast;
62 62
63use crate::builtin_type::BuiltinType; 63use crate::builtin_type::BuiltinType;
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs
index 5682e122d..50acc3f54 100644
--- a/crates/hir_def/src/nameres.rs
+++ b/crates/hir_def/src/nameres.rs
@@ -56,9 +56,9 @@ mod tests;
56 56
57use std::sync::Arc; 57use std::sync::Arc;
58 58
59use arena::Arena;
60use base_db::{CrateId, Edition, FileId}; 59use base_db::{CrateId, Edition, FileId};
61use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile}; 60use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile};
61use la_arena::Arena;
62use rustc_hash::FxHashMap; 62use rustc_hash::FxHashMap;
63use stdx::format_to; 63use stdx::format_to;
64use syntax::ast; 64use syntax::ast;
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs
index f027fd48d..0cd61698c 100644
--- a/crates/hir_def/src/nameres/collector.rs
+++ b/crates/hir_def/src/nameres/collector.rs
@@ -1469,8 +1469,8 @@ impl ModCollector<'_, '_> {
1469#[cfg(test)] 1469#[cfg(test)]
1470mod tests { 1470mod tests {
1471 use crate::{db::DefDatabase, test_db::TestDB}; 1471 use crate::{db::DefDatabase, test_db::TestDB};
1472 use arena::Arena;
1473 use base_db::{fixture::WithFixture, SourceDatabase}; 1472 use base_db::{fixture::WithFixture, SourceDatabase};
1473 use la_arena::Arena;
1474 1474
1475 use super::*; 1475 use super::*;
1476 1476
diff --git a/crates/hir_def/src/src.rs b/crates/hir_def/src/src.rs
index f67244b46..eb29265d9 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
3use arena::map::ArenaMap;
4use hir_expand::InFile; 3use hir_expand::InFile;
4use la_arena::map::ArenaMap;
5 5
6use crate::{db::DefDatabase, item_tree::ItemTreeNode, AssocItemLoc, ItemLoc}; 6use 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 fd64e7018..0a9beae8e 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.
12use arena::{map::ArenaMap, Arena, Idx, RawId}; 12use la_arena::{map::ArenaMap, Arena, Idx, RawId};
13 13
14pub(crate) struct Trace<T, V> { 14pub(crate) struct Trace<T, V> {
15 arena: Option<Arena<T>>, 15 arena: Option<Arena<T>>,
diff --git a/crates/hir_expand/Cargo.toml b/crates/hir_expand/Cargo.toml
index 9fad2ab94..b535a3d4f 100644
--- a/crates/hir_expand/Cargo.toml
+++ b/crates/hir_expand/Cargo.toml
@@ -13,8 +13,8 @@ doctest = false
13log = "0.4.8" 13log = "0.4.8"
14either = "1.5.3" 14either = "1.5.3"
15rustc-hash = "1.0.0" 15rustc-hash = "1.0.0"
16la-arena = "0.1.0"
16 17
17arena = { path = "../arena", version = "0.0.0" }
18base_db = { path = "../base_db", version = "0.0.0" } 18base_db = { path = "../base_db", version = "0.0.0" }
19syntax = { path = "../syntax", version = "0.0.0" } 19syntax = { path = "../syntax", version = "0.0.0" }
20parser = { path = "../parser", version = "0.0.0" } 20parser = { path = "../parser", version = "0.0.0" }
diff --git a/crates/hir_expand/src/ast_id_map.rs b/crates/hir_expand/src/ast_id_map.rs
index f63629b30..f4f6e11fd 100644
--- a/crates/hir_expand/src/ast_id_map.rs
+++ b/crates/hir_expand/src/ast_id_map.rs
@@ -12,7 +12,7 @@ use std::{
12 marker::PhantomData, 12 marker::PhantomData,
13}; 13};
14 14
15use arena::{Arena, Idx}; 15use la_arena::{Arena, Idx};
16use syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr}; 16use syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr};
17 17
18/// `AstId` points to an AST node in a specific file. 18/// `AstId` points to an AST node in a specific file.
diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml
index b0a453961..436c1405b 100644
--- a/crates/hir_ty/Cargo.toml
+++ b/crates/hir_ty/Cargo.toml
@@ -20,11 +20,11 @@ scoped-tls = "1"
20chalk-solve = { version = "0.47", default-features = false } 20chalk-solve = { version = "0.47", default-features = false }
21chalk-ir = "0.47" 21chalk-ir = "0.47"
22chalk-recursive = "0.47" 22chalk-recursive = "0.47"
23la-arena = "0.1.0"
23 24
24stdx = { path = "../stdx", version = "0.0.0" } 25stdx = { path = "../stdx", version = "0.0.0" }
25hir_def = { path = "../hir_def", version = "0.0.0" } 26hir_def = { path = "../hir_def", version = "0.0.0" }
26hir_expand = { path = "../hir_expand", version = "0.0.0" } 27hir_expand = { path = "../hir_expand", version = "0.0.0" }
27arena = { path = "../arena", version = "0.0.0" }
28base_db = { path = "../base_db", version = "0.0.0" } 28base_db = { path = "../base_db", version = "0.0.0" }
29profile = { path = "../profile", version = "0.0.0" } 29profile = { path = "../profile", version = "0.0.0" }
30syntax = { path = "../syntax", version = "0.0.0" } 30syntax = { path = "../syntax", version = "0.0.0" }
diff --git a/crates/hir_ty/src/db.rs b/crates/hir_ty/src/db.rs
index f3567c49e..b0e2a3b7d 100644
--- a/crates/hir_ty/src/db.rs
+++ b/crates/hir_ty/src/db.rs
@@ -2,12 +2,12 @@
2 2
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use arena::map::ArenaMap;
6use base_db::{impl_intern_key, salsa, CrateId, Upcast}; 5use base_db::{impl_intern_key, salsa, CrateId, Upcast};
7use hir_def::{ 6use hir_def::{
8 db::DefDatabase, expr::ExprId, ConstParamId, DefWithBodyId, FunctionId, GenericDefId, ImplId, 7 db::DefDatabase, expr::ExprId, ConstParamId, DefWithBodyId, FunctionId, GenericDefId, ImplId,
9 LocalFieldId, TypeParamId, VariantId, 8 LocalFieldId, TypeParamId, VariantId,
10}; 9};
10use la_arena::map::ArenaMap;
11 11
12use crate::{ 12use crate::{
13 method_resolution::{InherentImpls, TraitImpls}, 13 method_resolution::{InherentImpls, TraitImpls},
diff --git a/crates/hir_ty/src/diagnostics/match_check.rs b/crates/hir_ty/src/diagnostics/match_check.rs
index 61c47eec8..fbe760c39 100644
--- a/crates/hir_ty/src/diagnostics/match_check.rs
+++ b/crates/hir_ty/src/diagnostics/match_check.rs
@@ -218,13 +218,13 @@
218//! ``` 218//! ```
219use std::{iter, sync::Arc}; 219use std::{iter, sync::Arc};
220 220
221use arena::Idx;
222use hir_def::{ 221use hir_def::{
223 adt::VariantData, 222 adt::VariantData,
224 body::Body, 223 body::Body,
225 expr::{Expr, Literal, Pat, PatId}, 224 expr::{Expr, Literal, Pat, PatId},
226 AdtId, EnumVariantId, StructId, VariantId, 225 AdtId, EnumVariantId, StructId, VariantId,
227}; 226};
227use la_arena::Idx;
228use smallvec::{smallvec, SmallVec}; 228use smallvec::{smallvec, SmallVec};
229 229
230use crate::{db::HirDatabase, ApplicationTy, InferenceResult, Ty, TypeCtor}; 230use crate::{db::HirDatabase, ApplicationTy, InferenceResult, Ty, TypeCtor};
diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs
index a14d67c06..46a806b9a 100644
--- a/crates/hir_ty/src/infer.rs
+++ b/crates/hir_ty/src/infer.rs
@@ -18,7 +18,6 @@ use std::mem;
18use std::ops::Index; 18use std::ops::Index;
19use std::sync::Arc; 19use std::sync::Arc;
20 20
21use arena::map::ArenaMap;
22use hir_def::{ 21use hir_def::{
23 body::Body, 22 body::Body,
24 data::{ConstData, FunctionData, StaticData}, 23 data::{ConstData, FunctionData, StaticData},
@@ -31,6 +30,7 @@ use hir_def::{
31 TypeAliasId, VariantId, 30 TypeAliasId, VariantId,
32}; 31};
33use hir_expand::{diagnostics::DiagnosticSink, name::name}; 32use hir_expand::{diagnostics::DiagnosticSink, name::name};
33use la_arena::map::ArenaMap;
34use rustc_hash::FxHashMap; 34use rustc_hash::FxHashMap;
35use stdx::impl_from; 35use stdx::impl_from;
36use syntax::SmolStr; 36use syntax::SmolStr;
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs
index 9594cce8b..68d16f89a 100644
--- a/crates/hir_ty/src/lower.rs
+++ b/crates/hir_ty/src/lower.rs
@@ -7,7 +7,6 @@
7//! This usually involves resolving names, collecting generic arguments etc. 7//! This usually involves resolving names, collecting generic arguments etc.
8use std::{iter, sync::Arc}; 8use std::{iter, sync::Arc};
9 9
10use arena::map::ArenaMap;
11use base_db::CrateId; 10use base_db::CrateId;
12use hir_def::{ 11use hir_def::{
13 adt::StructKind, 12 adt::StructKind,
@@ -21,6 +20,7 @@ use hir_def::{
21 TypeAliasId, TypeParamId, UnionId, VariantId, 20 TypeAliasId, TypeParamId, UnionId, VariantId,
22}; 21};
23use hir_expand::name::Name; 22use hir_expand::name::Name;
23use la_arena::map::ArenaMap;
24use smallvec::SmallVec; 24use smallvec::SmallVec;
25use stdx::impl_from; 25use stdx::impl_from;
26use test_utils::mark; 26use test_utils::mark;
diff --git a/crates/profile/Cargo.toml b/crates/profile/Cargo.toml
index 4951f1835..096233a09 100644
--- a/crates/profile/Cargo.toml
+++ b/crates/profile/Cargo.toml
@@ -13,8 +13,7 @@ doctest = false
13once_cell = "1.3.1" 13once_cell = "1.3.1"
14cfg-if = "1" 14cfg-if = "1"
15libc = "0.2.73" 15libc = "0.2.73"
16 16la-arena = "0.1.0"
17arena = { path = "../arena", version = "0.0.0" }
18 17
19[target.'cfg(target_os = "linux")'.dependencies] 18[target.'cfg(target_os = "linux")'.dependencies]
20perf-event = "0.4" 19perf-event = "0.4"
diff --git a/crates/profile/src/tree.rs b/crates/profile/src/tree.rs
index 3fac1f36c..62f0c30b5 100644
--- a/crates/profile/src/tree.rs
+++ b/crates/profile/src/tree.rs
@@ -1,7 +1,7 @@
1//! A simple tree implementation which tries to not allocate all over the place. 1//! A simple tree implementation which tries to not allocate all over the place.
2use std::ops; 2use std::ops;
3 3
4use arena::Arena; 4use la_arena::Arena;
5 5
6#[derive(Default)] 6#[derive(Default)]
7pub(crate) struct Tree<T> { 7pub(crate) struct Tree<T> {
@@ -9,7 +9,7 @@ pub(crate) struct Tree<T> {
9 current_path: Vec<(Idx<T>, Option<Idx<T>>)>, 9 current_path: Vec<(Idx<T>, Option<Idx<T>>)>,
10} 10}
11 11
12pub(crate) type Idx<T> = arena::Idx<Node<T>>; 12pub(crate) type Idx<T> = la_arena::Idx<Node<T>>;
13 13
14impl<T> Tree<T> { 14impl<T> Tree<T> {
15 pub(crate) fn start(&mut self) 15 pub(crate) fn start(&mut self)
diff --git a/crates/project_model/Cargo.toml b/crates/project_model/Cargo.toml
index 855fb83ea..51e7a7070 100644
--- a/crates/project_model/Cargo.toml
+++ b/crates/project_model/Cargo.toml
@@ -17,8 +17,8 @@ serde = { version = "1.0.106", features = ["derive"] }
17serde_json = "1.0.48" 17serde_json = "1.0.48"
18anyhow = "1.0.26" 18anyhow = "1.0.26"
19itertools = "0.10.0" 19itertools = "0.10.0"
20la-arena = "0.1.0"
20 21
21arena = { path = "../arena", version = "0.0.0" }
22cfg = { path = "../cfg", version = "0.0.0" } 22cfg = { path = "../cfg", version = "0.0.0" }
23base_db = { path = "../base_db", version = "0.0.0" } 23base_db = { path = "../base_db", version = "0.0.0" }
24toolchain = { path = "../toolchain", version = "0.0.0" } 24toolchain = { path = "../toolchain", version = "0.0.0" }
diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs
index a1ab9c6db..c0ed37fc1 100644
--- a/crates/project_model/src/cargo_workspace.rs
+++ b/crates/project_model/src/cargo_workspace.rs
@@ -10,10 +10,10 @@ use std::{
10}; 10};
11 11
12use anyhow::{Context, Result}; 12use anyhow::{Context, Result};
13use arena::{Arena, Idx};
14use base_db::Edition; 13use base_db::Edition;
15use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId}; 14use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId};
16use itertools::Itertools; 15use itertools::Itertools;
16use la_arena::{Arena, Idx};
17use paths::{AbsPath, AbsPathBuf}; 17use paths::{AbsPath, AbsPathBuf};
18use rustc_hash::FxHashMap; 18use rustc_hash::FxHashMap;
19use stdx::JodChild; 19use stdx::JodChild;
diff --git a/crates/project_model/src/sysroot.rs b/crates/project_model/src/sysroot.rs
index 95b622715..ff44dae4a 100644
--- a/crates/project_model/src/sysroot.rs
+++ b/crates/project_model/src/sysroot.rs
@@ -7,7 +7,7 @@
7use std::{convert::TryFrom, env, ops, path::PathBuf, process::Command}; 7use std::{convert::TryFrom, env, ops, path::PathBuf, process::Command};
8 8
9use anyhow::{format_err, Result}; 9use anyhow::{format_err, Result};
10use arena::{Arena, Idx}; 10use la_arena::{Arena, Idx};
11use paths::{AbsPath, AbsPathBuf}; 11use paths::{AbsPath, AbsPathBuf};
12 12
13use crate::utf8_stdout; 13use crate::utf8_stdout;
diff --git a/lib/README.md b/lib/README.md
new file mode 100644
index 000000000..6b2eeac2c
--- /dev/null
+++ b/lib/README.md
@@ -0,0 +1,2 @@
1Crates in this directory are published to crates.io and obey semver.
2They *could* live in a separate repo, but we want to experiment with a monorepo setup.
diff --git a/crates/arena/Cargo.toml b/lib/arena/Cargo.toml
index 863eedf76..183a5bb6a 100644
--- a/crates/arena/Cargo.toml
+++ b/lib/arena/Cargo.toml
@@ -1,7 +1,7 @@
1[package] 1[package]
2name = "arena" 2name = "la-arena"
3version = "0.0.0" 3version = "0.1.0"
4description = "TBD" 4description = "Thy rope of sands..."
5license = "MIT OR Apache-2.0" 5license = "MIT OR Apache-2.0"
6authors = ["rust-analyzer developers"] 6authors = ["rust-analyzer developers"]
7edition = "2018" 7edition = "2018"
diff --git a/crates/arena/src/lib.rs b/lib/arena/src/lib.rs
index 3169aa5b8..3169aa5b8 100644
--- a/crates/arena/src/lib.rs
+++ b/lib/arena/src/lib.rs
diff --git a/crates/arena/src/map.rs b/lib/arena/src/map.rs
index 0f33907c0..0f33907c0 100644
--- a/crates/arena/src/map.rs
+++ b/lib/arena/src/map.rs