Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/proc_macro.rs')
| -rw-r--r-- | crates/hir-expand/src/proc_macro.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir-expand/src/proc_macro.rs b/crates/hir-expand/src/proc_macro.rs index 07808fea85..3dc3dcd760 100644 --- a/crates/hir-expand/src/proc_macro.rs +++ b/crates/hir-expand/src/proc_macro.rs @@ -238,6 +238,9 @@ impl CustomProcMacroExpander { let krate_graph = db.crate_graph(); // Proc macros have access to the environment variables of the invoking crate. let env = &krate_graph[calling_crate].env; + let current_dir = + krate_graph[calling_crate].proc_macro_cwd.as_deref().map(ToString::to_string); + match proc_macro.expander.expand( tt, attr_arg, @@ -245,10 +248,7 @@ impl CustomProcMacroExpander { def_site, call_site, mixed_site, - db.crate_workspace_data()[&calling_crate] - .proc_macro_cwd - .as_ref() - .map(ToString::to_string), + current_dir, ) { Ok(t) => ExpandResult::ok(t), Err(err) => match err { |