Rust-analyzer and the standard library workspace

⚓ Rust    📅 2025-09-10    👤 surdeus    👁️ 9      

surdeus

Warning

This post was published 64 days ago. The information described in this article may have changed.

Rust moved its standard library into a workspace about 13 months ago. I've experienced a weird condition in offline installations of rust-analyzer and VSCode where I lose the prelude. E.g., I have to import Some from core in order for RA to deduce the type of Some(1_i32). This problem goes away if I remove the Cargo.toml from the workspace root of the standard library (rust/library/Cargo.toml). I have seen this as recently as with Rust 1.89.0 and 0.4.2609 using the RA installed by rustup.

This seems like a "me" problem and not a bug. What can I do to debug this and get more introspection into how rust-analyzer is failing?

1 post - 1 participant

Read full topic

🏷️ Rust_feed