cargo

cargo package

Prepare a source distribution locally. Inspect the included files first and then build the packaged source. A crate archive is not the installed binary and does not upload anything. Example format: shell. Run only in a disposable copy of v17/fixtures/projects/distribution-demo. Expected result (not executed): The list includes src/main.rs; a verified .crate archive is expected under target/package. Common mistake: Skipping file review or treating packaging as publication.

Formal Syntax & Structure

rust syntaxrust
cargo package [OPTIONS]

Working Example

Example Snippetrust
cargo package --offline --listcargo package --offline
Rust Reference