Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #17114 - lnicola:hir-expand-in-tree, r=Veykril
minor: Add in-rust-tree feature to hir-expand CC https://github.com/rust-lang/rust/pull/124199#issuecomment-2067701168
bors 2024-04-20
parent c83d8cf · parent 4c94e69 · commit 55d9a53
-rw-r--r--crates/hir-def/Cargo.toml2
-rw-r--r--crates/hir-expand/Cargo.toml3
-rw-r--r--crates/hir-expand/src/lib.rs2
-rw-r--r--crates/hir-ty/Cargo.toml2
-rw-r--r--crates/hir/Cargo.toml2
-rw-r--r--crates/load-cargo/Cargo.toml3
-rw-r--r--crates/rust-analyzer/Cargo.toml1
7 files changed, 11 insertions, 4 deletions
diff --git a/crates/hir-def/Cargo.toml b/crates/hir-def/Cargo.toml
index 523ff6fc40..41c59ea0d9 100644
--- a/crates/hir-def/Cargo.toml
+++ b/crates/hir-def/Cargo.toml
@@ -54,7 +54,7 @@ test-utils.workspace = true
test-fixture.workspace = true
[features]
-in-rust-tree = []
+in-rust-tree = ["hir-expand/in-rust-tree"]
[lints]
workspace = true
diff --git a/crates/hir-expand/Cargo.toml b/crates/hir-expand/Cargo.toml
index a9eeb58b2b..ca05618aec 100644
--- a/crates/hir-expand/Cargo.toml
+++ b/crates/hir-expand/Cargo.toml
@@ -37,5 +37,8 @@ parser.workspace = true
[dev-dependencies]
expect-test = "1.4.0"
+[features]
+in-rust-tree = ["syntax/in-rust-tree"]
+
[lints]
workspace = true
diff --git a/crates/hir-expand/src/lib.rs b/crates/hir-expand/src/lib.rs
index db8bbeccef..338bd25ede 100644
--- a/crates/hir-expand/src/lib.rs
+++ b/crates/hir-expand/src/lib.rs
@@ -3,7 +3,7 @@
//! Specifically, it implements a concept of `MacroFile` -- a file whose syntax
//! tree originates not from the text of some `FileId`, but from some macro
//! expansion.
-
+#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#![warn(rust_2018_idioms, unused_lifetimes)]
pub mod attrs;
diff --git a/crates/hir-ty/Cargo.toml b/crates/hir-ty/Cargo.toml
index bf47374016..a83ee9824e 100644
--- a/crates/hir-ty/Cargo.toml
+++ b/crates/hir-ty/Cargo.toml
@@ -61,7 +61,7 @@ test-utils.workspace = true
test-fixture.workspace = true
[features]
-in-rust-tree = []
+in-rust-tree = ["hir-expand/in-rust-tree"]
[lints]
workspace = true
diff --git a/crates/hir/Cargo.toml b/crates/hir/Cargo.toml
index 190722075a..6d7ecd1e50 100644
--- a/crates/hir/Cargo.toml
+++ b/crates/hir/Cargo.toml
@@ -33,7 +33,7 @@ tt.workspace = true
span.workspace = true
[features]
-in-rust-tree = []
+in-rust-tree = ["hir-expand/in-rust-tree"]
[lints]
workspace = true
diff --git a/crates/load-cargo/Cargo.toml b/crates/load-cargo/Cargo.toml
index 48e84a7b25..b6f90ec53b 100644
--- a/crates/load-cargo/Cargo.toml
+++ b/crates/load-cargo/Cargo.toml
@@ -28,5 +28,8 @@ tt.workspace = true
vfs-notify.workspace = true
vfs.workspace = true
+[features]
+in-rust-tree = ["hir-expand/in-rust-tree"]
+
[lints]
workspace = true
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index 1cc3343e5f..cd3349899e 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -94,6 +94,7 @@ in-rust-tree = [
"hir/in-rust-tree",
"hir-def/in-rust-tree",
"hir-ty/in-rust-tree",
+ "load-cargo/in-rust-tree",
]
[lints]