Skip to content

Build targets of workspace crates do not appear to be honoured #11268

Closed
@huntc

Description

@huntc

rust-analyzer version: rust-analyzer version: 54782428a 2022-01-12 dev

rustc version: rustc 1.59.0-nightly (c5ecc1570 2021-12-15)

Further to the "Respect .cargo/config.toml" PR, the config.toml file of a crate within a workspace does not appear to be honoured. For example, if I have a project named client and it has two crates, app and embedded-app, and embedded-app has a .cargo/config.toml, then the latter does not appear to be considered when determining build targets.

To reproduce this issue:

  1. Download the branch at Upgrade Embassy version titanclass/embassy-start#4
  2. rustup target add thumbv7em-none-eabihf if you don't have that target
  3. Open the project's workspace file (embassy-start.code-workspace) in VSC
  4. Navigate to client/embedded-app/src/boards/nrf52840_dk.rs
  5. Wait for RA to complete its indexing
  6. Note that interrupt::take! on L18 is able to be resolved
  7. Remove the "rust-analyzer.cargo.target": "thumbv7em-none-eabihf" from the workspace file
  8. Reload RA
  9. Wait for RA to complete its indexing
  10. Note that interrupt::take! can no longer be resolved

My expectation is that the build target of client/.embedded-app/.cargo/config.toml should be honoured, and that I should not have to declare a rust-analyzer.cargo.target.

Related? #8521

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions