Skip to content

Rust-analyzer creates target/rust-analyzer/metadata directories since latest update #20067

@tomaka

Description

@tomaka

My project consists in a root virtual workspace with a Cargo.toml and a target directory, that various sub-crates, each with their own Cargo.toml.
Something like this:

- Cargo.toml (virtual workspace)
- Cargo.lock
- target
- engine/Cargo.toml
- engine/...
- bin-common/Cargo.toml
- bin-common/...
- ... (several others sub-crates)

After updating rust-analyzer to the latest version (rust-analyzer version: 0.3.2509-standalone (0100bc7 2025-06-22)), I see multiple Cargo.lock files being generated in the project sub-directories.

In other words, I see these files being generated:

engine/target/rust-analyzer/metadata/sysroot/Cargo.lock
engine/target/rust-analyzer/metadata/workspace/Cargo.lock
bin-common/target/rust-analyzer/metadata/sysroot/Cargo.lock
bin-common/target/rust-analyzer/metadata/workspace/Cargo.lock
... (several others)

After a quick search, I suppose that this change comes from #20018

The engine/target/, bin-common/target/, ... directories do not exist otherwise, so these Cargo.lock files are all they contain.

Surely these files should be in the target directory at the root, shouldn't they?

Metadata

Metadata

Assignees

Labels

A-cargocargo related issuesBroken WindowBugs / technical debt to be addressed immediatelyC-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions