Skip to content

target selection for per-project rust-analyzer.toml does not seem to work #22653

Description

@J-Pai

rust-analyzer version: rust-analyzer 1.96.0 (ac68faa 2026-05-25)

rustc version: rustc 1.96.0 (ac68faa20 2026-05-25)

editor or extension: neovim v0.12.2

relevant settings:

rust-analyzer.toml at root of project:

[cargo]
allTargets = false
target = "wasm32-unknwon-unknown"

code snippet to reproduce:

#[cfg(target_arch = "wasm32")]
fn main() {
}
  • Neovim configuration has an inline check that tells me the wasm32 target_arch is disabled. Downstream dependencies also do not have this feature enabled.

  • Does not seem like there are bugs tracking the fact that the target configuration does not appear to work in cargo.

  • Other options seem to be fine (e.g. check configurations), but anything underneath cargo seems to be ignore.

  • Would be nice to get this feature working (or make a note that it is not supported in https://rust-analyzer.github.io/book/configuration.html.

  • Working a in a project with mixed targets (wasm32 for frontend, aarch64 for backend) pretty much requires the ability to provide a per-project or per-crate rust-analyzer.toml file so code completion will work properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configconfigurationC-bugCategory: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions