Skip to content

Error message and docs for [replace] are misleading #4212

@nrc

Description

@nrc

e.g., Cargo.toml:

[workspace]
members = [
    ...
]

[replace]
"rls-data" = { path = "data" }

The error here is that the package id is missing a version number (changing rls-data to rls-data:0.7.0 fixed the problem). However, the error cargo gives is "no package or project section found.".

The documentation here is confusing too: this section states "Each key in the [replace] table is a package id specification" where "package id specification" links to http://doc.crates.io/pkgid-spec.html where the version appears optional, both in the grammar and the examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.A-documenting-cargo-itselfArea: Cargo's documentationA-workspacesArea: workspaces

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions