Skip to content

False unresolved import for async runtime main macro #11302

New issue

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

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

Already on GitHub? # to your account

Closed
YoshieraHuang opened this issue Jan 17, 2022 · 2 comments
Closed

False unresolved import for async runtime main macro #11302

YoshieraHuang opened this issue Jan 17, 2022 · 2 comments
Labels
A-nameres name, path and module resolution C-bug Category: bug

Comments

@YoshieraHuang
Copy link

rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)

rust-analyzer version: 0add6e9 2021-12-20 stable

rustc version: (eg. output of rustc -V)

rustc 1.57.0 (f1edd0429 2021-11-29)

rust-analyzer extension version:

0.2.867

Hi, I try to re-export the main and test macro of tokio in my crate just like this:

pub use tokio::{main, test};

rust_analyzer warns unresolved import for main macro but the test macro is ok. However, this codes pass cargo check and cargo build.

The same issue also happens for async-std async runtime.

@jonas-schievink
Copy link
Contributor

I think this was brought up before, it's because of the #[cfg(not(test))] on the macro

@flodiebold flodiebold added A-nameres name, path and module resolution C-bug Category: bug labels Mar 31, 2022
@flodiebold
Copy link
Member

Duplicate of #12450.

@flodiebold flodiebold closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-nameres name, path and module resolution C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants