Skip to content

Commit 248a557

Browse files
committed
Auto merge of #17981 - lnicola:proc-macro-cwd, r=Veykril
minor: Fix cwd used for proc macro expansion Fixes #17980.
2 parents 199c01d + 51055f7 commit 248a557

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/tools/rust-analyzer/crates/project-model/src/env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub(crate) fn inject_rustc_tool_env(
6565
// NOTE: Technically we should set this for all crates, but that will worsen the deduplication
6666
// logic so for now just keeping it proc-macros ought to be fine.
6767
if kind.is_proc_macro() {
68-
env.set("CARGO_RUSTC_CURRENT_DIR", cargo.manifest_path().to_string());
68+
env.set("CARGO_RUSTC_CURRENT_DIR", cargo.manifest_path().parent().to_string());
6969
}
7070
}
7171

Diff for: src/tools/rust-analyzer/crates/project-model/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ fn crate_graph_dedup() {
278278
assert_eq!(regex_crate_graph.iter().count(), 60);
279279

280280
crate_graph.extend(regex_crate_graph, &mut regex_proc_macros, |(_, a), (_, b)| a == b);
281-
assert_eq!(crate_graph.iter().count(), 119);
281+
assert_eq!(crate_graph.iter().count(), 118);
282282
}
283283

284284
#[test]

0 commit comments

Comments
 (0)