diff --git a/crates/hir-def/Cargo.toml b/crates/hir-def/Cargo.toml index 523ff6fc404..41c59ea0d93 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 a9eeb58b2ba..ca05618aecd 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 db8bbeccef8..338bd25ede3 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 bf473740166..a83ee9824e2 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 190722075a2..6d7ecd1e50b 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 48e84a7b25e..b6f90ec53b8 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 1cc3343e5fc..cd3349899e9 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]