Skip to content
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

Cannot create expander for ... #402

Closed
crptz opened this issue Mar 9, 2023 · 7 comments
Closed

Cannot create expander for ... #402

crptz opened this issue Mar 9, 2023 · 7 comments

Comments

@crptz
Copy link

crptz commented Mar 9, 2023

Hi there,

I set up a project with cargo generate for Arduino Uno, although it's running perfectly, rust-analyzer gives me an error

proc macro `entry` not expanded: Cannot create expander for /home/path/to/project/target/debug/deps/libavr_device_macros-8c55ff3523662538.so: unsupported ABI `rustc 1.64.0-nightly (6dba4ed21 2022-07-09)`rust-analyzer[unresolved-proc-macro](https://rust-analyzer.github.io/manual.html#unresolved-proc-macro)

image

I've been searching for possible fixes but I couldn't find anything here in issues.

Any hint would be much appreciated, cheers !

@crptz
Copy link
Author

crptz commented Mar 9, 2023

I've found a "solution"
I basically disabled the errors for unresolved-proc-macro in rust-analyzer settings but is this the correct way to resolve this?

    "rust-analyzer.diagnostics.disabled": [
        "unresolved-proc-macro"
    ],

@Rahix
Copy link
Owner

Rahix commented Mar 9, 2023

Hi,

I think you need to post this issue on the rust-analyzer bug tracker. I don't think this is something strictly related to avr-hal.

@crptz
Copy link
Author

crptz commented Mar 9, 2023

hey, ok ! I'll search for advice there, thank you, closing the issue

@crptz crptz closed this as completed Mar 9, 2023
@BoManev
Copy link

BoManev commented Jun 13, 2023

Here's an article explaining the root cause of this issue. This was fixed for versions starting 2022-08-*.
Im nor sure how this could be fixed. @Rahix can the rustc version be bumped

@Rahix
Copy link
Owner

Rahix commented Jun 14, 2023

rustc version bump is currently blocked on rust-lang/rust#106619 unfortunately...

@crptz
Copy link
Author

crptz commented Jun 14, 2023

I'll give a read to the article once a I have free time although I haven't checked the issue for a while now.

@BoManev
Copy link

BoManev commented Jun 16, 2023

I found a solution. VS Code starts 2 processes one for rust-analyzer and one for the proc_macro server. It searches for the proc_macro executable in the nightly-xxx/libexec. Install nightly-2022-08-03-x86_64-unknown-linux-gnu (the earliest version to include the executable) and then copy the libexec/rust-analyzer-proc-macro-srv from the 08-03 nightly to the 07-10.

@Rahix maybe we should add this fix to the repo readme (assuming that a lot of ppl use VSCode)

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

No branches or pull requests

3 participants