1
Fork 0

Replace proc_macro::SourceFile by Span::{file, local_file}.

This commit is contained in:
Mara Bos 2025-04-11 14:35:00 +02:00
parent 6788ce76c9
commit 3962069982
10 changed files with 61 additions and 93 deletions

View file

@ -25,7 +25,10 @@ fn invocation_relative_path_to_absolute(span: Span, path: &str) -> PathBuf {
path.to_path_buf()
} else {
// `/a/b/c/foo/bar.rs` contains the current macro invocation
#[cfg(bootstrap)]
let mut source_file_path = span.source_file().path();
#[cfg(not(bootstrap))]
let mut source_file_path = span.local_file().unwrap();
// `/a/b/c/foo/`
source_file_path.pop();
// `/a/b/c/foo/../locales/en-US/example.ftl`