diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2024-08-28 13:00:26 +0300 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2024-08-28 13:20:21 +0300 |
| commit | 51055f71414da15963d547729fb11bf3e952da18 (patch) | |
| tree | 17d49a5ed26ced00f803c482867e34e2fc4f3cd2 | |
| parent | e4c404e2bdedef41b4982912cdfb207cd9fc7754 (diff) | |
Fix cwd used for proc macro expansion
| -rw-r--r-- | src/tools/rust-analyzer/crates/project-model/src/env.rs | 2 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/project-model/src/tests.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/project-model/src/env.rs b/src/tools/rust-analyzer/crates/project-model/src/env.rs index ec0f94b8f01..ff9d2035f60 100644 --- a/src/tools/rust-analyzer/crates/project-model/src/env.rs +++ b/src/tools/rust-analyzer/crates/project-model/src/env.rs @@ -65,7 +65,7 @@ pub(crate) fn inject_rustc_tool_env( // NOTE: Technically we should set this for all crates, but that will worsen the deduplication // logic so for now just keeping it proc-macros ought to be fine. if kind.is_proc_macro() { - env.set("CARGO_RUSTC_CURRENT_DIR", cargo.manifest_path().to_string()); + env.set("CARGO_RUSTC_CURRENT_DIR", cargo.manifest_path().parent().to_string()); } } diff --git a/src/tools/rust-analyzer/crates/project-model/src/tests.rs b/src/tools/rust-analyzer/crates/project-model/src/tests.rs index 920ee7bd4f1..f540bb94c19 100644 --- a/src/tools/rust-analyzer/crates/project-model/src/tests.rs +++ b/src/tools/rust-analyzer/crates/project-model/src/tests.rs @@ -278,7 +278,7 @@ fn crate_graph_dedup() { assert_eq!(regex_crate_graph.iter().count(), 60); crate_graph.extend(regex_crate_graph, &mut regex_proc_macros, |(_, a), (_, b)| a == b); - assert_eq!(crate_graph.iter().count(), 119); + assert_eq!(crate_graph.iter().count(), 118); } #[test] |
