From 68c223872562a8d746d4f1045d508887a0cbca5e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 10:19:09 +0200 Subject: [PATCH] Rename ra_cfg -> cfg --- Cargo.lock | 30 +++++++++---------- crates/{ra_cfg => cfg}/Cargo.toml | 8 ++--- crates/{ra_cfg => cfg}/src/cfg_expr.rs | 0 crates/{ra_cfg => cfg}/src/lib.rs | 2 +- crates/ra_db/Cargo.toml | 2 +- crates/ra_db/src/fixture.rs | 2 +- crates/ra_db/src/input.rs | 2 +- crates/ra_hir_def/Cargo.toml | 2 +- crates/ra_hir_def/src/adt.rs | 2 +- crates/ra_hir_def/src/attr.rs | 2 +- crates/ra_hir_def/src/body.rs | 2 +- crates/ra_hir_def/src/nameres/collector.rs | 2 +- crates/ra_ide/Cargo.toml | 2 +- crates/ra_ide/src/lib.rs | 2 +- crates/ra_ide/src/mock_analysis.rs | 2 +- crates/ra_ide/src/parent_module.rs | 2 +- crates/ra_ide/src/runnables.rs | 2 +- crates/ra_project_model/Cargo.toml | 2 +- crates/ra_project_model/src/cfg_flag.rs | 2 +- crates/ra_project_model/src/lib.rs | 2 +- crates/rust-analyzer/Cargo.toml | 2 +- crates/rust-analyzer/src/cargo_target_spec.rs | 4 +-- 22 files changed, 39 insertions(+), 39 deletions(-) rename crates/{ra_cfg => cfg}/Cargo.toml (88%) rename crates/{ra_cfg => cfg}/src/cfg_expr.rs (100%) rename crates/{ra_cfg => cfg}/src/lib.rs (95%) diff --git a/Cargo.lock b/Cargo.lock index a63cd58f27..18c979b39e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,6 +112,16 @@ version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" +[[package]] +name = "cfg" +version = "0.0.0" +dependencies = [ + "mbe", + "rustc-hash", + "syntax", + "tt", +] + [[package]] name = "cfg-if" version = "0.1.10" @@ -955,22 +965,12 @@ dependencies = [ "text_edit", ] -[[package]] -name = "ra_cfg" -version = "0.1.0" -dependencies = [ - "mbe", - "rustc-hash", - "syntax", - "tt", -] - [[package]] name = "ra_db" version = "0.1.0" dependencies = [ + "cfg", "profile", - "ra_cfg", "rustc-hash", "salsa", "stdx", @@ -1012,6 +1012,7 @@ version = "0.1.0" dependencies = [ "anymap", "arena", + "cfg", "drop_bomb", "either", "expect", @@ -1022,7 +1023,6 @@ dependencies = [ "mbe", "once_cell", "profile", - "ra_cfg", "ra_db", "ra_hir_expand", "rustc-hash", @@ -1082,6 +1082,7 @@ dependencies = [ name = "ra_ide" version = "0.1.0" dependencies = [ + "cfg", "either", "expect", "indexmap", @@ -1090,7 +1091,6 @@ dependencies = [ "oorandom", "profile", "ra_assists", - "ra_cfg", "ra_db", "ra_fmt", "ra_hir", @@ -1141,9 +1141,9 @@ dependencies = [ "anyhow", "arena", "cargo_metadata", + "cfg", "log", "paths", - "ra_cfg", "ra_db", "ra_proc_macro", "rustc-hash", @@ -1240,6 +1240,7 @@ name = "rust-analyzer" version = "0.1.0" dependencies = [ "anyhow", + "cfg", "crossbeam-channel", "env_logger", "expect", @@ -1256,7 +1257,6 @@ dependencies = [ "pico-args", "proc_macro_srv", "profile", - "ra_cfg", "ra_db", "ra_hir", "ra_hir_def", diff --git a/crates/ra_cfg/Cargo.toml b/crates/cfg/Cargo.toml similarity index 88% rename from crates/ra_cfg/Cargo.toml rename to crates/cfg/Cargo.toml index 661e539043..d2ea551d18 100644 --- a/crates/ra_cfg/Cargo.toml +++ b/crates/cfg/Cargo.toml @@ -1,9 +1,9 @@ [package] -edition = "2018" -name = "ra_cfg" -version = "0.1.0" -authors = ["rust-analyzer developers"] +name = "cfg" +version = "0.0.0" license = "MIT OR Apache-2.0" +authors = ["rust-analyzer developers"] +edition = "2018" [lib] doctest = false diff --git a/crates/ra_cfg/src/cfg_expr.rs b/crates/cfg/src/cfg_expr.rs similarity index 100% rename from crates/ra_cfg/src/cfg_expr.rs rename to crates/cfg/src/cfg_expr.rs diff --git a/crates/ra_cfg/src/lib.rs b/crates/cfg/src/lib.rs similarity index 95% rename from crates/ra_cfg/src/lib.rs rename to crates/cfg/src/lib.rs index 6fb37bf9f1..a9d50e698a 100644 --- a/crates/ra_cfg/src/lib.rs +++ b/crates/cfg/src/lib.rs @@ -1,4 +1,4 @@ -//! ra_cfg defines conditional compiling options, `cfg` attibute parser and evaluator +//! cfg defines conditional compiling options, `cfg` attibute parser and evaluator mod cfg_expr; diff --git a/crates/ra_db/Cargo.toml b/crates/ra_db/Cargo.toml index 156ea1ee4b..ad432f096a 100644 --- a/crates/ra_db/Cargo.toml +++ b/crates/ra_db/Cargo.toml @@ -13,7 +13,7 @@ salsa = "0.15.2" rustc-hash = "1.1.0" syntax = { path = "../syntax" } -ra_cfg = { path = "../ra_cfg" } +cfg = { path = "../cfg" } profile = { path = "../profile" } tt = { path = "../tt" } test_utils = { path = "../test_utils" } diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index 2aafb99654..5ff8ead0e5 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs @@ -59,7 +59,7 @@ //! ``` use std::{str::FromStr, sync::Arc}; -use ra_cfg::CfgOptions; +use cfg::CfgOptions; use rustc_hash::FxHashMap; use test_utils::{extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER}; use vfs::{file_set::FileSet, VfsPath}; diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 12a8634997..f3d65cdf02 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs @@ -8,7 +8,7 @@ use std::{fmt, iter::FromIterator, ops, str::FromStr, sync::Arc}; -use ra_cfg::CfgOptions; +use cfg::CfgOptions; use rustc_hash::{FxHashMap, FxHashSet}; use syntax::SmolStr; use tt::TokenExpander; diff --git a/crates/ra_hir_def/Cargo.toml b/crates/ra_hir_def/Cargo.toml index ba7916c305..e7d3c4d5be 100644 --- a/crates/ra_hir_def/Cargo.toml +++ b/crates/ra_hir_def/Cargo.toml @@ -29,7 +29,7 @@ profile = { path = "../profile" } hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } test_utils = { path = "../test_utils" } mbe = { path = "../mbe" } -ra_cfg = { path = "../ra_cfg" } +cfg = { path = "../cfg" } tt = { path = "../tt" } [dev-dependencies] diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index c83219d771..d69ff2fc79 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs @@ -23,7 +23,7 @@ use crate::{ EnumId, HasModule, LocalEnumVariantId, LocalFieldId, Lookup, ModuleId, StructId, UnionId, VariantId, }; -use ra_cfg::CfgOptions; +use cfg::CfgOptions; /// Note that we use `StructData` for unions as well! #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/crates/ra_hir_def/src/attr.rs b/crates/ra_hir_def/src/attr.rs index 36dc8b8166..1e5b06ca02 100644 --- a/crates/ra_hir_def/src/attr.rs +++ b/crates/ra_hir_def/src/attr.rs @@ -5,7 +5,7 @@ use std::{ops, sync::Arc}; use either::Either; use hir_expand::{hygiene::Hygiene, AstId, InFile}; use mbe::ast_to_token_tree; -use ra_cfg::{CfgExpr, CfgOptions}; +use cfg::{CfgExpr, CfgOptions}; use syntax::{ ast::{self, AstNode, AttrsOwner}, SmolStr, diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 7c33966a71..3568513d1e 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs @@ -9,7 +9,7 @@ use arena::{map::ArenaMap, Arena}; use drop_bomb::DropBomb; use either::Either; use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; -use ra_cfg::CfgOptions; +use cfg::CfgOptions; use ra_db::CrateId; use rustc_hash::FxHashMap; use syntax::{ast, AstNode, AstPtr}; diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index f7270ec91c..fa2dadfc5b 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs @@ -11,7 +11,7 @@ use hir_expand::{ proc_macro::ProcMacroExpander, HirFileId, MacroCallId, MacroDefId, MacroDefKind, }; -use ra_cfg::CfgOptions; +use cfg::CfgOptions; use ra_db::{CrateId, FileId, ProcMacroId}; use rustc_hash::FxHashMap; use syntax::ast; diff --git a/crates/ra_ide/Cargo.toml b/crates/ra_ide/Cargo.toml index 8e0fa59178..c60e555455 100644 --- a/crates/ra_ide/Cargo.toml +++ b/crates/ra_ide/Cargo.toml @@ -25,7 +25,7 @@ syntax = { path = "../syntax" } text_edit = { path = "../text_edit" } ra_db = { path = "../ra_db" } ra_ide_db = { path = "../ra_ide_db" } -ra_cfg = { path = "../ra_cfg" } +cfg = { path = "../cfg" } ra_fmt = { path = "../ra_fmt" } profile = { path = "../profile" } test_utils = { path = "../test_utils" } diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 20967ba990..1fdf17800d 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -47,7 +47,7 @@ mod typing; use std::sync::Arc; -use ra_cfg::CfgOptions; +use cfg::CfgOptions; use ra_db::{ salsa::{self, ParallelDatabase}, CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath, diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs index c7e0f4b58f..a4691f0284 100644 --- a/crates/ra_ide/src/mock_analysis.rs +++ b/crates/ra_ide/src/mock_analysis.rs @@ -1,7 +1,7 @@ //! FIXME: write short doc here use std::sync::Arc; -use ra_cfg::CfgOptions; +use cfg::CfgOptions; use ra_db::{CrateName, FileSet, SourceRoot, VfsPath}; use test_utils::{ extract_annotations, extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER, diff --git a/crates/ra_ide/src/parent_module.rs b/crates/ra_ide/src/parent_module.rs index 69af0c86ad..b78388e6b1 100644 --- a/crates/ra_ide/src/parent_module.rs +++ b/crates/ra_ide/src/parent_module.rs @@ -63,7 +63,7 @@ pub(crate) fn crate_for(db: &RootDatabase, file_id: FileId) -> Vec { #[cfg(test)] mod tests { - use ra_cfg::CfgOptions; + use cfg::CfgOptions; use ra_db::Env; use test_utils::mark; diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs index 54cb3b3094..7d8a210b7f 100644 --- a/crates/ra_ide/src/runnables.rs +++ b/crates/ra_ide/src/runnables.rs @@ -2,7 +2,7 @@ use std::fmt; use hir::{AsAssocItem, Attrs, HirFileId, InFile, Semantics}; use itertools::Itertools; -use ra_cfg::CfgExpr; +use cfg::CfgExpr; use ra_ide_db::RootDatabase; use syntax::{ ast::{self, AstNode, AttrsOwner, DocCommentsOwner, ModuleItemOwner, NameOwner}, diff --git a/crates/ra_project_model/Cargo.toml b/crates/ra_project_model/Cargo.toml index 171fe86264..52f2d57b3b 100644 --- a/crates/ra_project_model/Cargo.toml +++ b/crates/ra_project_model/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = "1.1.0" cargo_metadata = "0.11.1" arena = { path = "../arena" } -ra_cfg = { path = "../ra_cfg" } +cfg = { path = "../cfg" } ra_db = { path = "../ra_db" } toolchain = { path = "../toolchain" } ra_proc_macro = { path = "../ra_proc_macro" } diff --git a/crates/ra_project_model/src/cfg_flag.rs b/crates/ra_project_model/src/cfg_flag.rs index bd50056c68..e92962cf67 100644 --- a/crates/ra_project_model/src/cfg_flag.rs +++ b/crates/ra_project_model/src/cfg_flag.rs @@ -3,7 +3,7 @@ //! rustc main.rs --cfg foo --cfg 'feature="bar"' use std::str::FromStr; -use ra_cfg::CfgOptions; +use cfg::CfgOptions; use stdx::split_once; #[derive(Clone, Eq, PartialEq, Debug)] diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index 46f44910c0..47e7d24203 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs @@ -13,7 +13,7 @@ use std::{ use anyhow::{bail, Context, Result}; use paths::{AbsPath, AbsPathBuf}; -use ra_cfg::CfgOptions; +use cfg::CfgOptions; use ra_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId}; use rustc_hash::{FxHashMap, FxHashSet}; diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 156f8d538e..440b1cd134 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -42,7 +42,7 @@ syntax = { path = "../syntax" } text_edit = { path = "../text_edit" } vfs = { path = "../vfs" } vfs-notify = { path = "../vfs-notify" } -ra_cfg = { path = "../ra_cfg" } +cfg = { path = "../cfg" } toolchain = { path = "../toolchain" } # This should only be used in CLI diff --git a/crates/rust-analyzer/src/cargo_target_spec.rs b/crates/rust-analyzer/src/cargo_target_spec.rs index 7929368c0c..87ddd25bf2 100644 --- a/crates/rust-analyzer/src/cargo_target_spec.rs +++ b/crates/rust-analyzer/src/cargo_target_spec.rs @@ -1,6 +1,6 @@ //! See `CargoTargetSpec` -use ra_cfg::CfgExpr; +use cfg::CfgExpr; use ra_ide::{FileId, RunnableKind, TestId}; use ra_project_model::{self, TargetKind}; use vfs::AbsPathBuf; @@ -178,7 +178,7 @@ mod tests { use super::*; use mbe::ast_to_token_tree; - use ra_cfg::CfgExpr; + use cfg::CfgExpr; use syntax::{ ast::{self, AstNode}, SmolStr,