Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: RA in VS Code highlights `#[tokio::main]`as error despite successful compilation with nightly Rust
RA in VS Code highlights `#[tokio::main]`as error despite successful compilation with nightly Rust
โ Rust ๐ 2025-08-25 ๐ค surdeus ๐๏ธ 5โโEnvironment:โโ
Rust toolchain: 1.91.0-nightly (809200ec9 2025-08-24)
Editor: VS Code (latest stable)
rust-analyzer: v0.3.2593
,
tokio = { version = "1.47.1", features = ["full"] }
โโIssue:โโ
The #[tokio::main]
macro is highlighted as an error in VS Code by rust-analyzer
(red underline, error hint: "tokio::main: proc macro server error: Cannot create expander for ~\target\debug\deps\tokio_macros-0db0bbc0b2211d25.dll: unsupported metadata version 10
"). However, the project compiles and runs successfully via cargo build/run
on the same toolchain. This occurs even in minimal async examples:
#[tokio::main]
async fn main() {
println!("Hello, tokio!");
}
โโQuestion:โโ
Is this a known issue with RA + nightly + Tokio? Are there workarounds beyond suppressing the diagnostic?
1 post - 1 participant
๐ท๏ธ Rust_feed