We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c661e5e commit 45799a1Copy full SHA for 45799a1
crates/hir-expand/src/proc_macro.rs
@@ -238,17 +238,16 @@ impl CustomProcMacroExpander {
238
let krate_graph = db.crate_graph();
239
// Proc macros have access to the environment variables of the invoking crate.
240
let env = &krate_graph[calling_crate].env;
241
+ let current_dir =
242
+ env.get("CARGO_RUSTC_CURRENT_DIR").or_else(|| env.get("CARGO_MANIFEST_DIR"));
243
match proc_macro.expander.expand(
244
tt,
245
attr_arg,
246
env,
247
def_site,
248
call_site,
249
mixed_site,
- db.crate_workspace_data()[&calling_crate]
- .proc_macro_cwd
250
- .as_ref()
251
- .map(ToString::to_string),
+ current_dir
252
) {
253
Ok(t) => ExpandResult::ok(t),
254
Err(err) => match err {
0 commit comments