cargo

cargo publish

Publication sends a package version to a registry and may be effectively permanent. Review licenses, files, tests, ownership and the destination before any real upload. A dry run performs local preparation without uploading but is not proof of registry acceptance. Example format: shell. Illustrative only; do not execute against real accounts or unreviewed sources. Expected result (not executed): A publishable package can undergo preparation without upload. The private teaching fixture has publish = false and is not intended for this command. Common mistake: Removing --dry-run just to see what happens, or assuming a dry run reserves a name.

Formal Syntax & Structure

rust syntaxrust
cargo publish [OPTIONS]

Working Example

Example Snippetrust
cargo publish --dry-run --registry crates-io
Rust Reference