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

Proc macros do not expand on latest nightly #13373

Closed
SkyfallWasTaken opened this issue Oct 9, 2022 · 9 comments
Closed

Proc macros do not expand on latest nightly #13373

SkyfallWasTaken opened this issue Oct 9, 2022 · 9 comments
Labels
C-support Category: support questions

Comments

@SkyfallWasTaken
Copy link

rust-analyzer version: rust-analyzer version: 0.3.1229-standalone

rustc version: rustc 1.66.0-nightly (8796e7a9c 2022-10-08)

relevant settings: n/a I think?

RA no longer works with today's nightly when it comes to proc macros:

This can be reproduced with the following code:

#[tokio::main]
async fn main() {
    println!("Hello world");
}

fn f1() {}

The error is:

proc macro `main` not expanded: Cannot create expander for /home/skyfall/Projects/custard/target/debug/deps/libtokio_macros-a5c4f94b46da1247.so: UnsupportedABIrust-analyzer[unresolved-proc-macro](https://rust-analyzer.github.io/manual.html#unresolved-proc-macro)

The rest of RA works, so in the example it'd warn about f1 not being used.

@fasterthanlime
Copy link
Contributor

Am also experiencing issues with completion in tokio::main right now (cf. #13355, maybe also #13322),

Although I am able to use the "Expand macro recursively" functionality to expand it:

image

And I do have this in my "Rust Analyzer Language Server" output:

[INFO rust_analyzer::reload] Loaded proc-macros for /home/amos/bearcove/promac/target/debug/deps/libtokio_macros-789c7494be924096.so: ["main", "main_rt", "test", "test_rt", "main_fail", "test_fail", "select_priv_declare_output_enum", "select_priv_clean_pattern"]

I wasn't seeing any completion in tokio::main for rustc 1.64.0 either, will investigate some more.

@fasterthanlime
Copy link
Contributor

Are you using bazel, or buck, or any other non-cargo build system? If so, your issue is a duplicate of #13322 and unrelated to #13355.

@SkyfallWasTaken
Copy link
Author

Are you using bazel, or buck, or any other non-cargo build system? If so, your issue is a duplicate of #13322 and unrelated to #13355.

Nope, just cargo.

@fasterthanlime
Copy link
Contributor

Nope, just cargo.

Is that in vscode? How is rust-analyzer installed? How is rustc/cargo installed?

@SkyfallWasTaken
Copy link
Author

SkyfallWasTaken commented Oct 9, 2022

Is that in vscode?

Yep.

How is rust-analyzer installed?

I'm pretty sure I got it from the prompt after installing the VS Code RA extension. Not 100% sure, though.

How is rustc/cargo installed?

With Linux rustup

@Veykril
Copy link
Member

Veykril commented Feb 9, 2023

Do you still experience this problem?

@Veykril Veykril added the C-support Category: support questions label Feb 9, 2023
@fasterthanlime
Copy link
Contributor

Do you still experience this problem?

I know you're probably asking @SkyfallWasTaken, but because I confirmed that issue back when it was opened, I can confirm I'm no longer able to reproduce it (even with an era-appropriate tokio version).

@Veykril
Copy link
Member

Veykril commented Feb 9, 2023

Ye I think we can close this then.

@Veykril Veykril closed this as completed Feb 9, 2023
@SkyfallWasTaken
Copy link
Author

Do you still experience this problem?

Nah, I haven't had the issue in a while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-support Category: support questions
Projects
None yet
Development

No branches or pull requests

3 participants