Skip to content

Unable to use workspace dependency in patch #15568

Open
@tigerros

Description

@tigerros

I tried this code:

# empty project
[workspace.dependencies]
shakmaty = { git = "https://github.com/niklasf/shakmaty", branch = "master", default-features = false }

[patch.crates-io]
shakmaty = { workspace = true }

I expected to see this happen: dependencies that use shakmaty from crates.io get replaced by the git version.

Instead, this happened:

error: failed to parse manifest at `Cargo.toml`

Caused by:
  dependency (shakmaty) specified without providing a local path, Git repository, version, or workspace dependency to use

The error says I can use a workspace dependency.

Meta

rustc --version --verbose:

rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-pc-windows-msvc
release: 1.86.0
LLVM version: 19.1.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-patchArea: [patch] table overrideA-workspacesArea: workspacesC-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions