-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Wrong macro expansion #18571
Comments
The error reported now changes to a compile error only raised by my macro in the latest commit, however I am pretty sure (as the author of the macro) that the error should not be raised, evidenced by the fact that Old commit I am now pretty certain this is an error in rust-analyzer's macro expansion, thus I am changing the issue title. |
impl
on foreign type
You can use the "Rust Analyzer: Expand macro recursively" function to see what RA expands the macro to and try to find what's wrong there. |
I know but all I can infer is that rust-analyzer has issues with macro expansions, but I can't identify what issue it is as I am not knowledgeable enough in how rust-analyzer operates that I cannot provide any meaningful insights other than rust-analyzer has problems expanding my macros ¯\_(ツ)_/¯ |
You know your macro though, so hopefully could be able to tell what part of the expansion is wrong? 😅 |
rust-analyzer version: 0.3.2196-standalone
rustc version: (eg. output of
rustc -V
)editor or extension: v0.3.2196
relevant settings: all unset
repository link (if public, optional): rust-enumeration
code snippet to reproduce: I do not know how to make a minimized reproducible example. tests/test.rs reports an error with "cannot define inherent
impl
on foreign type" and "unexpected token in input" from the macro invocation in line 56~60. However,cargo test
runs fine without reporting any error. While attempting to reproduce the issue, you may need to modify the file (e.g. enter a new line and delete it) as the error may not be reported. Attempting to inline macro will result in missing tokens. I do not know if this is only reproducible on my machine.The text was updated successfully, but these errors were encountered: