Skip to content

Don't apply rust-analyzer.cargo.features to rustc private crates #14327

Closed
@bjorn3

Description

@bjorn3

If I use "rust-analyzer.rustc.source": "discover" + [package.metadata.rust-analyzer] rustc_private = true rust-analyzer will pass all features in rust-analyzer.cargo.features not just when getting the metadata for the main workspace, but also for getting the metadata for the rustc private crates, causing metadata loading to fail for them. By the way please also pop up a message when getting metadata for rustc private crates fails rather than only showing it in the output pane saying

[ERROR project_model::workspace] Failed to read Cargo metadata from rustc source at /home/gh-bjorn3/.rustup/toolchains/nightly-2023-03-10-aarch64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.toml e=Failed to run `"cargo" "metadata" "--format-version" "1" "--features" "unstable-features,__check_build_system_using_ra" "--manifest-path" "/home/gh-bjorn3/.rustup/toolchains/nightly-2023-03-10-aarch64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.toml" "--filter-platform" "aarch64-unknown-linux-gnu"`

rust-analyzer version: rust-analyzer version: 0.3.1426-standalone (0a956ec 2023-03-05)

rustc version: rustc 1.70.0-nightly (39f2657d1 2023-03-09)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargocargo related issuesC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions