7271: prepare to publish el libro de arena r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2021-01-14 16:06:30 +00:00 committed by GitHub
commit f88f3d6885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 49 additions and 42 deletions

24
Cargo.lock generated
View File

@ -36,10 +36,6 @@ version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344"
[[package]]
name = "arena"
version = "0.0.0"
[[package]] [[package]]
name = "arrayvec" name = "arrayvec"
version = "0.5.2" version = "0.5.2"
@ -547,7 +543,6 @@ name = "hir_def"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"anymap", "anymap",
"arena",
"base_db", "base_db",
"cfg", "cfg",
"drop_bomb", "drop_bomb",
@ -557,6 +552,7 @@ dependencies = [
"hir_expand", "hir_expand",
"indexmap", "indexmap",
"itertools 0.10.0", "itertools 0.10.0",
"la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log", "log",
"mbe", "mbe",
"once_cell", "once_cell",
@ -573,9 +569,9 @@ dependencies = [
name = "hir_expand" name = "hir_expand"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"arena",
"base_db", "base_db",
"either", "either",
"la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log", "log",
"mbe", "mbe",
"parser", "parser",
@ -590,7 +586,6 @@ dependencies = [
name = "hir_ty" name = "hir_ty"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"arena",
"arrayvec", "arrayvec",
"base_db", "base_db",
"chalk-ir", "chalk-ir",
@ -601,6 +596,7 @@ dependencies = [
"hir_def", "hir_def",
"hir_expand", "hir_expand",
"itertools 0.10.0", "itertools 0.10.0",
"la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log", "log",
"once_cell", "once_cell",
"profile", "profile",
@ -771,6 +767,16 @@ dependencies = [
"winapi-build", "winapi-build",
] ]
[[package]]
name = "la-arena"
version = "0.1.0"
[[package]]
name = "la-arena"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0385ab3b926cc05c78275d7ac6799c21fb964ada0a45cdaeaf1415d6a3dda39"
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.4.0"
@ -1196,8 +1202,8 @@ version = "0.0.0"
name = "profile" name = "profile"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"arena",
"cfg-if 1.0.0", "cfg-if 1.0.0",
"la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc", "libc",
"once_cell", "once_cell",
"perf-event", "perf-event",
@ -1208,11 +1214,11 @@ name = "project_model"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arena",
"base_db", "base_db",
"cargo_metadata", "cargo_metadata",
"cfg", "cfg",
"itertools 0.10.0", "itertools 0.10.0",
"la-arena 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log", "log",
"paths", "paths",
"proc_macro_api", "proc_macro_api",

View File

@ -1,5 +1,5 @@
[workspace] [workspace]
members = [ "crates/*", "xtask/" ] members = [ "xtask/", "lib/*", "crates/*" ]
[profile.dev] [profile.dev]
# Disabling debug info speeds up builds a bunch, # Disabling debug info speeds up builds a bunch,

View File

@ -20,9 +20,9 @@ fst = { version = "0.4", default-features = false }
itertools = "0.10.0" itertools = "0.10.0"
indexmap = "1.4.0" indexmap = "1.4.0"
smallvec = "1.4.0" smallvec = "1.4.0"
la-arena = "0.1.0"
stdx = { path = "../stdx", version = "0.0.0" } stdx = { path = "../stdx", version = "0.0.0" }
arena = { path = "../arena", version = "0.0.0" }
base_db = { path = "../base_db", version = "0.0.0" } base_db = { path = "../base_db", version = "0.0.0" }
syntax = { path = "../syntax", version = "0.0.0" } syntax = { path = "../syntax", version = "0.0.0" }
profile = { path = "../profile", version = "0.0.0" } profile = { path = "../profile", version = "0.0.0" }

View File

@ -2,13 +2,13 @@
use std::sync::Arc; use std::sync::Arc;
use arena::{map::ArenaMap, Arena};
use base_db::CrateId; use base_db::CrateId;
use either::Either; use either::Either;
use hir_expand::{ use hir_expand::{
name::{AsName, Name}, name::{AsName, Name},
InFile, InFile,
}; };
use la_arena::{map::ArenaMap, Arena};
use syntax::ast::{self, NameOwner, VisibilityOwner}; use syntax::ast::{self, NameOwner, VisibilityOwner};
use tt::{Delimiter, DelimiterKind, Leaf, Subtree, TokenTree}; use tt::{Delimiter, DelimiterKind, Leaf, Subtree, TokenTree};

View File

@ -2,12 +2,12 @@
use std::{ops, sync::Arc}; use std::{ops, sync::Arc};
use arena::map::ArenaMap;
use base_db::CrateId; use base_db::CrateId;
use cfg::{CfgExpr, CfgOptions}; use cfg::{CfgExpr, CfgOptions};
use either::Either; use either::Either;
use hir_expand::{hygiene::Hygiene, name::AsName, AstId, InFile}; use hir_expand::{hygiene::Hygiene, name::AsName, AstId, InFile};
use itertools::Itertools; use itertools::Itertools;
use la_arena::map::ArenaMap;
use mbe::ast_to_token_tree; use mbe::ast_to_token_tree;
use syntax::{ use syntax::{
ast::{self, AstNode, AttrsOwner}, ast::{self, AstNode, AttrsOwner},

View File

@ -8,7 +8,6 @@
use std::{mem, ops::Index, sync::Arc}; use std::{mem, ops::Index, sync::Arc};
use arena::{map::ArenaMap, Arena};
use base_db::CrateId; use base_db::CrateId;
use cfg::CfgOptions; use cfg::CfgOptions;
use drop_bomb::DropBomb; use drop_bomb::DropBomb;
@ -17,6 +16,7 @@
ast_id_map::AstIdMap, diagnostics::DiagnosticSink, hygiene::Hygiene, AstId, ExpandResult, ast_id_map::AstIdMap, diagnostics::DiagnosticSink, hygiene::Hygiene, AstId, ExpandResult,
HirFileId, InFile, MacroDefId, HirFileId, InFile, MacroDefId,
}; };
use la_arena::{map::ArenaMap, Arena};
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use syntax::{ast, AstNode, AstPtr}; use syntax::{ast, AstNode, AstPtr};
use test_utils::mark; use test_utils::mark;

View File

@ -3,13 +3,13 @@
use std::{any::type_name, sync::Arc}; use std::{any::type_name, sync::Arc};
use arena::Arena;
use either::Either; use either::Either;
use hir_expand::{ use hir_expand::{
hygiene::Hygiene, hygiene::Hygiene,
name::{name, AsName, Name}, name::{name, AsName, Name},
ExpandError, HirFileId, MacroDefId, MacroDefKind, ExpandError, HirFileId, MacroDefId, MacroDefKind,
}; };
use la_arena::Arena;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use syntax::{ use syntax::{
ast::{ ast::{

View File

@ -1,8 +1,8 @@
//! Name resolution for expressions. //! Name resolution for expressions.
use std::sync::Arc; use std::sync::Arc;
use arena::{Arena, Idx};
use hir_expand::name::Name; use hir_expand::name::Name;
use la_arena::{Arena, Idx};
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use crate::{ use crate::{

View File

@ -1,9 +1,9 @@
//! Defines database & queries for name resolution. //! Defines database & queries for name resolution.
use std::sync::Arc; use std::sync::Arc;
use arena::map::ArenaMap;
use base_db::{salsa, CrateId, SourceDatabase, Upcast}; use base_db::{salsa, CrateId, SourceDatabase, Upcast};
use hir_expand::{db::AstDatabase, HirFileId}; use hir_expand::{db::AstDatabase, HirFileId};
use la_arena::map::ArenaMap;
use syntax::SmolStr; use syntax::SmolStr;
use crate::{ use crate::{

View File

@ -12,8 +12,8 @@
//! //!
//! See also a neighboring `body` module. //! See also a neighboring `body` module.
use arena::{Idx, RawId};
use hir_expand::name::Name; use hir_expand::name::Name;
use la_arena::{Idx, RawId};
use syntax::ast::RangeOp; use syntax::ast::RangeOp;
use crate::{ use crate::{

View File

@ -4,13 +4,13 @@
//! in rustc. //! in rustc.
use std::sync::Arc; use std::sync::Arc;
use arena::{map::ArenaMap, Arena};
use base_db::FileId; use base_db::FileId;
use either::Either; use either::Either;
use hir_expand::{ use hir_expand::{
name::{name, AsName, Name}, name::{name, AsName, Name},
InFile, InFile,
}; };
use la_arena::{map::ArenaMap, Arena};
use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner};
use crate::{ use crate::{

View File

@ -11,7 +11,6 @@
sync::Arc, sync::Arc,
}; };
use arena::{Arena, Idx, RawId};
use ast::{AstNode, NameOwner, StructKind}; use ast::{AstNode, NameOwner, StructKind};
use base_db::CrateId; use base_db::CrateId;
use either::Either; use either::Either;
@ -21,6 +20,7 @@
name::{name, AsName, Name}, name::{name, AsName, Name},
HirFileId, InFile, HirFileId, InFile,
}; };
use la_arena::{Arena, Idx, RawId};
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use smallvec::SmallVec; use smallvec::SmallVec;
use syntax::{ast, match_ast}; use syntax::{ast, match_ast};

View File

@ -52,12 +52,12 @@ macro_rules! eprintln {
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use arena::Idx;
use base_db::{impl_intern_key, salsa, CrateId}; use base_db::{impl_intern_key, salsa, CrateId};
use hir_expand::{ use hir_expand::{
ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile, ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile,
MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
}; };
use la_arena::Idx;
use syntax::ast; use syntax::ast;
use crate::builtin_type::BuiltinType; use crate::builtin_type::BuiltinType;

View File

@ -56,9 +56,9 @@
use std::sync::Arc; use std::sync::Arc;
use arena::Arena;
use base_db::{CrateId, Edition, FileId}; use base_db::{CrateId, Edition, FileId};
use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile}; use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile};
use la_arena::Arena;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use stdx::format_to; use stdx::format_to;
use syntax::ast; use syntax::ast;

View File

@ -1469,8 +1469,8 @@ fn emit_unconfigured_diagnostic(&mut self, item: ModItem, cfg: &CfgExpr) {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::{db::DefDatabase, test_db::TestDB}; use crate::{db::DefDatabase, test_db::TestDB};
use arena::Arena;
use base_db::{fixture::WithFixture, SourceDatabase}; use base_db::{fixture::WithFixture, SourceDatabase};
use la_arena::Arena;
use super::*; use super::*;

View File

@ -1,7 +1,7 @@
//! Utilities for mapping between hir IDs and the surface syntax. //! Utilities for mapping between hir IDs and the surface syntax.
use arena::map::ArenaMap;
use hir_expand::InFile; use hir_expand::InFile;
use la_arena::map::ArenaMap;
use crate::{db::DefDatabase, item_tree::ItemTreeNode, AssocItemLoc, ItemLoc}; use crate::{db::DefDatabase, item_tree::ItemTreeNode, AssocItemLoc, ItemLoc};

View File

@ -9,7 +9,7 @@
//! absolute offsets. The `Trace` structure (inspired, at least in name, by //! absolute offsets. The `Trace` structure (inspired, at least in name, by
//! Kotlin's `BindingTrace`) allows use the same code to compute both //! Kotlin's `BindingTrace`) allows use the same code to compute both
//! projections. //! projections.
use arena::{map::ArenaMap, Arena, Idx, RawId}; use la_arena::{map::ArenaMap, Arena, Idx, RawId};
pub(crate) struct Trace<T, V> { pub(crate) struct Trace<T, V> {
arena: Option<Arena<T>>, arena: Option<Arena<T>>,

View File

@ -13,8 +13,8 @@ doctest = false
log = "0.4.8" log = "0.4.8"
either = "1.5.3" either = "1.5.3"
rustc-hash = "1.0.0" rustc-hash = "1.0.0"
la-arena = "0.1.0"
arena = { path = "../arena", version = "0.0.0" }
base_db = { path = "../base_db", version = "0.0.0" } base_db = { path = "../base_db", version = "0.0.0" }
syntax = { path = "../syntax", version = "0.0.0" } syntax = { path = "../syntax", version = "0.0.0" }
parser = { path = "../parser", version = "0.0.0" } parser = { path = "../parser", version = "0.0.0" }

View File

@ -12,7 +12,7 @@
marker::PhantomData, marker::PhantomData,
}; };
use arena::{Arena, Idx}; use la_arena::{Arena, Idx};
use syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr}; use syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr};
/// `AstId` points to an AST node in a specific file. /// `AstId` points to an AST node in a specific file.

View File

@ -20,11 +20,11 @@ scoped-tls = "1"
chalk-solve = { version = "0.47", default-features = false } chalk-solve = { version = "0.47", default-features = false }
chalk-ir = "0.47" chalk-ir = "0.47"
chalk-recursive = "0.47" chalk-recursive = "0.47"
la-arena = "0.1.0"
stdx = { path = "../stdx", version = "0.0.0" } stdx = { path = "../stdx", version = "0.0.0" }
hir_def = { path = "../hir_def", version = "0.0.0" } hir_def = { path = "../hir_def", version = "0.0.0" }
hir_expand = { path = "../hir_expand", version = "0.0.0" } hir_expand = { path = "../hir_expand", version = "0.0.0" }
arena = { path = "../arena", version = "0.0.0" }
base_db = { path = "../base_db", version = "0.0.0" } base_db = { path = "../base_db", version = "0.0.0" }
profile = { path = "../profile", version = "0.0.0" } profile = { path = "../profile", version = "0.0.0" }
syntax = { path = "../syntax", version = "0.0.0" } syntax = { path = "../syntax", version = "0.0.0" }

View File

@ -2,12 +2,12 @@
use std::sync::Arc; use std::sync::Arc;
use arena::map::ArenaMap;
use base_db::{impl_intern_key, salsa, CrateId, Upcast}; use base_db::{impl_intern_key, salsa, CrateId, Upcast};
use hir_def::{ use hir_def::{
db::DefDatabase, expr::ExprId, ConstParamId, DefWithBodyId, FunctionId, GenericDefId, ImplId, db::DefDatabase, expr::ExprId, ConstParamId, DefWithBodyId, FunctionId, GenericDefId, ImplId,
LocalFieldId, TypeParamId, VariantId, LocalFieldId, TypeParamId, VariantId,
}; };
use la_arena::map::ArenaMap;
use crate::{ use crate::{
method_resolution::{InherentImpls, TraitImpls}, method_resolution::{InherentImpls, TraitImpls},

View File

@ -218,13 +218,13 @@
//! ``` //! ```
use std::{iter, sync::Arc}; use std::{iter, sync::Arc};
use arena::Idx;
use hir_def::{ use hir_def::{
adt::VariantData, adt::VariantData,
body::Body, body::Body,
expr::{Expr, Literal, Pat, PatId}, expr::{Expr, Literal, Pat, PatId},
AdtId, EnumVariantId, StructId, VariantId, AdtId, EnumVariantId, StructId, VariantId,
}; };
use la_arena::Idx;
use smallvec::{smallvec, SmallVec}; use smallvec::{smallvec, SmallVec};
use crate::{db::HirDatabase, ApplicationTy, InferenceResult, Ty, TypeCtor}; use crate::{db::HirDatabase, ApplicationTy, InferenceResult, Ty, TypeCtor};

View File

@ -18,7 +18,6 @@
use std::ops::Index; use std::ops::Index;
use std::sync::Arc; use std::sync::Arc;
use arena::map::ArenaMap;
use hir_def::{ use hir_def::{
body::Body, body::Body,
data::{ConstData, FunctionData, StaticData}, data::{ConstData, FunctionData, StaticData},
@ -31,6 +30,7 @@
TypeAliasId, VariantId, TypeAliasId, VariantId,
}; };
use hir_expand::{diagnostics::DiagnosticSink, name::name}; use hir_expand::{diagnostics::DiagnosticSink, name::name};
use la_arena::map::ArenaMap;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use stdx::impl_from; use stdx::impl_from;
use syntax::SmolStr; use syntax::SmolStr;

View File

@ -7,7 +7,6 @@
//! This usually involves resolving names, collecting generic arguments etc. //! This usually involves resolving names, collecting generic arguments etc.
use std::{iter, sync::Arc}; use std::{iter, sync::Arc};
use arena::map::ArenaMap;
use base_db::CrateId; use base_db::CrateId;
use hir_def::{ use hir_def::{
adt::StructKind, adt::StructKind,
@ -21,6 +20,7 @@
TypeAliasId, TypeParamId, UnionId, VariantId, TypeAliasId, TypeParamId, UnionId, VariantId,
}; };
use hir_expand::name::Name; use hir_expand::name::Name;
use la_arena::map::ArenaMap;
use smallvec::SmallVec; use smallvec::SmallVec;
use stdx::impl_from; use stdx::impl_from;
use test_utils::mark; use test_utils::mark;

View File

@ -13,8 +13,7 @@ doctest = false
once_cell = "1.3.1" once_cell = "1.3.1"
cfg-if = "1" cfg-if = "1"
libc = "0.2.73" libc = "0.2.73"
la-arena = "0.1.0"
arena = { path = "../arena", version = "0.0.0" }
[target.'cfg(target_os = "linux")'.dependencies] [target.'cfg(target_os = "linux")'.dependencies]
perf-event = "0.4" perf-event = "0.4"

View File

@ -1,7 +1,7 @@
//! A simple tree implementation which tries to not allocate all over the place. //! A simple tree implementation which tries to not allocate all over the place.
use std::ops; use std::ops;
use arena::Arena; use la_arena::Arena;
#[derive(Default)] #[derive(Default)]
pub(crate) struct Tree<T> { pub(crate) struct Tree<T> {
@ -9,7 +9,7 @@ pub(crate) struct Tree<T> {
current_path: Vec<(Idx<T>, Option<Idx<T>>)>, current_path: Vec<(Idx<T>, Option<Idx<T>>)>,
} }
pub(crate) type Idx<T> = arena::Idx<Node<T>>; pub(crate) type Idx<T> = la_arena::Idx<Node<T>>;
impl<T> Tree<T> { impl<T> Tree<T> {
pub(crate) fn start(&mut self) pub(crate) fn start(&mut self)

View File

@ -17,8 +17,8 @@ serde = { version = "1.0.106", features = ["derive"] }
serde_json = "1.0.48" serde_json = "1.0.48"
anyhow = "1.0.26" anyhow = "1.0.26"
itertools = "0.10.0" itertools = "0.10.0"
la-arena = "0.1.0"
arena = { path = "../arena", version = "0.0.0" }
cfg = { path = "../cfg", version = "0.0.0" } cfg = { path = "../cfg", version = "0.0.0" }
base_db = { path = "../base_db", version = "0.0.0" } base_db = { path = "../base_db", version = "0.0.0" }
toolchain = { path = "../toolchain", version = "0.0.0" } toolchain = { path = "../toolchain", version = "0.0.0" }

View File

@ -10,10 +10,10 @@
}; };
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use arena::{Arena, Idx};
use base_db::Edition; use base_db::Edition;
use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId}; use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId};
use itertools::Itertools; use itertools::Itertools;
use la_arena::{Arena, Idx};
use paths::{AbsPath, AbsPathBuf}; use paths::{AbsPath, AbsPathBuf};
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use stdx::JodChild; use stdx::JodChild;

View File

@ -7,7 +7,7 @@
use std::{convert::TryFrom, env, ops, path::PathBuf, process::Command}; use std::{convert::TryFrom, env, ops, path::PathBuf, process::Command};
use anyhow::{format_err, Result}; use anyhow::{format_err, Result};
use arena::{Arena, Idx}; use la_arena::{Arena, Idx};
use paths::{AbsPath, AbsPathBuf}; use paths::{AbsPath, AbsPathBuf};
use crate::utf8_stdout; use crate::utf8_stdout;

2
lib/README.md Normal file
View File

@ -0,0 +1,2 @@
Crates in this directory are published to crates.io and obey semver.
They *could* live in a separate repo, but we want to experiment with a monorepo setup.

View File

@ -1,7 +1,7 @@
[package] [package]
name = "arena" name = "la-arena"
version = "0.0.0" version = "0.1.0"
description = "TBD" description = "Thy rope of sands..."
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
authors = ["rust-analyzer developers"] authors = ["rust-analyzer developers"]
edition = "2018" edition = "2018"