Unnamed repository; edit this file 'description' to name the repository.
Split out rustc_parse_format from rustc_dependencies
Lukas Wirth 2024-01-08
parent b97ab00 · commit e25e0dd
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml3
-rw-r--r--crates/hir-def/Cargo.toml3
-rw-r--r--crates/hir-def/src/hir/format_args.rs2
-rw-r--r--crates/hir-def/src/lib.rs9
-rw-r--r--crates/rustc-dependencies/Cargo.toml1
-rw-r--r--crates/rustc-dependencies/src/lib.rs11
7 files changed, 11 insertions, 20 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 98ae47640f..547940c91d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -513,6 +513,7 @@ dependencies = [
"mbe",
"once_cell",
"profile",
+ "ra-ap-rustc_parse_format",
"rustc-dependencies",
"rustc-hash",
"smallvec",
@@ -1605,7 +1606,6 @@ version = "0.0.0"
dependencies = [
"ra-ap-rustc_abi",
"ra-ap-rustc_index",
- "ra-ap-rustc_parse_format",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 296ccb2dfa..1734c55a3f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -80,7 +80,8 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
vfs = { path = "./crates/vfs", version = "0.0.0" }
rustc-dependencies = { path = "./crates/rustc-dependencies", version = "0.0.0" }
-ra-ap-rustc_lexer = "0.21.0"
+ra-ap-rustc_lexer = { version = "0.21.0", default-features = false }
+ra-ap-rustc_parse_format = { version = "0.21.0", default-features = false }
# local crates that aren't published to crates.io. These should not have versions.
sourcegen = { path = "./crates/sourcegen" }
diff --git a/crates/hir-def/Cargo.toml b/crates/hir-def/Cargo.toml
index 5933d30040..fea7d81c6a 100644
--- a/crates/hir-def/Cargo.toml
+++ b/crates/hir-def/Cargo.toml
@@ -29,6 +29,7 @@ smallvec.workspace = true
hashbrown.workspace = true
triomphe.workspace = true
+ra-ap-rustc_parse_format.workspace = true
rustc-dependencies.workspace = true
# local deps
@@ -56,4 +57,4 @@ test-fixture.workspace = true
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
[lints]
-workspace = true \ No newline at end of file
+workspace = true
diff --git a/crates/hir-def/src/hir/format_args.rs b/crates/hir-def/src/hir/format_args.rs
index 7fc33abc7c..c0d1738b50 100644
--- a/crates/hir-def/src/hir/format_args.rs
+++ b/crates/hir-def/src/hir/format_args.rs
@@ -2,7 +2,7 @@
use std::mem;
use hir_expand::name::Name;
-use rustc_dependencies::parse_format as parse;
+use rustc_parse_format as parse;
use stdx::TupleExt;
use syntax::{
ast::{self, IsString},
diff --git a/crates/hir-def/src/lib.rs b/crates/hir-def/src/lib.rs
index 250d7b677b..9d042ea935 100644
--- a/crates/hir-def/src/lib.rs
+++ b/crates/hir-def/src/lib.rs
@@ -10,10 +10,11 @@
#![warn(rust_2018_idioms, unused_lifetimes)]
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
-#[allow(unused)]
-macro_rules! eprintln {
- ($($tt:tt)*) => { stdx::eprintln!($($tt)*) };
-}
+#[cfg(feature = "in-rust-tree")]
+extern crate rustc_parse_format;
+
+#[cfg(not(feature = "in-rust-tree"))]
+extern crate ra_ap_rustc_parse_format as rustc_parse_format;
pub mod db;
diff --git a/crates/rustc-dependencies/Cargo.toml b/crates/rustc-dependencies/Cargo.toml
index ae8abc6cc7..a14cc60860 100644
--- a/crates/rustc-dependencies/Cargo.toml
+++ b/crates/rustc-dependencies/Cargo.toml
@@ -11,7 +11,6 @@ authors.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-ra-ap-rustc_parse_format = { version = "0.21.0", default-features = false }
ra-ap-rustc_index = { version = "0.21.0", default-features = false }
ra-ap-rustc_abi = { version = "0.21.0", default-features = false }
diff --git a/crates/rustc-dependencies/src/lib.rs b/crates/rustc-dependencies/src/lib.rs
index d3f386fe08..d2aafe8a02 100644
--- a/crates/rustc-dependencies/src/lib.rs
+++ b/crates/rustc-dependencies/src/lib.rs
@@ -4,17 +4,6 @@
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(feature = "in-rust-tree")]
-extern crate rustc_parse_format;
-
-pub mod parse_format {
- #[cfg(not(feature = "in-rust-tree"))]
- pub use ::ra_ap_rustc_parse_format::*;
-
- #[cfg(feature = "in-rust-tree")]
- pub use ::rustc_parse_format::*;
-}
-
-#[cfg(feature = "in-rust-tree")]
extern crate rustc_abi;
pub mod abi {