Skip to content

Missing prelude in rust-analyzer when using build-std in workspace #18307

@eivindbergem

Description

@eivindbergem

rust-analyzer version: rust-analyzer 1.84.0-nightly (e7c0d27 2024-10-15)
rustc version: rustc 1.84.0-nightly (e7c0d27 2024-10-15)
editor or extension: Emacs
code snippet to reproduce: full example

See linked repo for minimal example to reproduce.

When opening lib/src/lib.rs in editor, rust-analyzer gives errors saying that Option and other parts of Rust prelude is not in scope. The crate builds without errors using cargo build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-nameresname, path and module resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions