Skip to content

cargo publish error message unhelpful with publish = false #11262

@wooorm

Description

@wooorm

Problem

$ cargo publish --dry-run
error: `xxxxxxxx` cannot be published.
The registry `crates-io` is not listed in the `publish` value in Cargo.toml.

It’s a bit stupid on my part, I forgot for a second that I had publish = false in my Cargo.toml to prevent publishing, but this error message threw me off.
I can imagine that some other folks would run into this too, so I’m raising this here.

Proposed Solution

How about an error message, if publish = false, along the lines of:

error: `xxxxxxxx` cannot be published.
`publish` is set to `false` in Cargo.toml and prevents publishing.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-publish

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions