Skip to content

"not implemented" macro_error with rustc nightly feature "source_file" #11264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yezuochang opened this issue Jan 12, 2022 · 1 comment · Fixed by #11802
Closed

"not implemented" macro_error with rustc nightly feature "source_file" #11264

yezuochang opened this issue Jan 12, 2022 · 1 comment · Fixed by #11802
Labels
A-macro macro expansion

Comments

@yezuochang
Copy link

rust-analyzer version: rust-analyzer 5478242 2022-01-12 nightly
rustc version: nightly-2021-12-20-x86_64-unknown-linux-gnu

When using the span().source_file() to get the path of the caller, RA reports the "not implemented" macro error.

The code works find with cargo build.

The whole project reproducing the issue is in: https://github.com/yezuochang/proc_macro_example

#[proc_macro]
pub fn testmacro(input: TokenStream) -> TokenStream {
    let _caller_path = input
        .clone()
        .into_iter()
        .last()
        .unwrap()
        .span()
        .source_file()
        .path();
    return input;
}

image

@lnicola
Copy link
Member

lnicola commented Jan 12, 2022

CC #10570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro macro expansion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants