CARGO-RUSTC(1) General Commands Manual CARGO-RUSTC(1) (NAME) cargo-rustc - (SYNOPSIS) cargo rustc [options] [-- args] (DESCRIPTION) ( -p ) . args . -L --extern --crate-type args . rustc . . --lib --bin . Cargo RUSTFLAGS build.rustflags . (OPTIONS) (Package Selection) . -p (workspace) . -p spec, --package spec . SPEC cargo-pkgid(1) . (Target Selection) cargo rustc . . . CARGO_BIN_EXE_ env var . . --bin --example --test --bench * ? [] . Cargo . --lib . --bin name . . --bins . --example name . . --examples . --test name . . --tests test = true . . lib ( ). test . --bench name . . --benches bench = true . bench . lib ( ). bench . --all-targets . --lib --bins --tests --benches --examples . . default . . -F features, --features features . (workspace) package-name/feature-name . . --all-features . --no-default-features default . (Compilation Options) --target triple . . . --- . : o rustc --print target-list. o "host-tuple" . ( xtask ). o . Custom Target Lookup Path . build.target . Cargo . build cache . -r, --release release. --profile . --profile name . rustc : o check -- cargo-check(1) dev . o test -- cargo-test(1) cfg test . rustc tests . o bench -- cargo-bench(1) test. . --timings . cargo-timing.html target/cargo-timings . . . --crate-type crate-type . crate-type Cargo . crate-type . --crate-type . lib example . (Output Options) --target-dir directory . CARGO_TARGET_DIR build.target-dir . target . -v, --verbose (verbose). " " . term.verbose . -q, --quiet (log) cargo. term.quiet . --color when . : o auto (): . o always: . o never: . term.color . --message-format fmt (diagnostic). . : o human (): . short json . o short: . human json . o json: JSON (stdout). . human short . o json-diagnostic-short: rendered JSON "" rustc . human short . o json-diagnostic-rendered-ansi: rendered JSON ANSI rustc . human short . o json-render-diagnostics: Cargo rustc JSON Cargo JSON rustc . JSON Cargo rustc . human short . (Manifest Options) --manifest-path path Cargo.toml. Cargo Cargo.toml . --ignore-rust-version rust-version . --locked Cargo.lock . Cargo : o (lock file) . o (Cargo) . (deterministic) CI . --offline Cargo . Cargo . Cargo . () . Cargo (crates) (index) . cargo-fetch(1) . net.offline . --frozen --locked --offline . +toolchain Cargo rustup cargo + (toolchain) rustup ( +stable +nightly). rustup . --config KEY=VALUE PATH Cargo . TOML KEY=VALUE . . . -C PATH . cargo (Cargo.toml) .cargo/config.toml . : cargo -C path/to/my-project build. nightly -Z unstable-options ( #10098 ). -h, --help . -Z flag ( nightly) Cargo. cargo -Z help . (Miscellaneous Options) -j N, --jobs N . build.jobs . . . default . 0 . --keep-going (crate) . fails works cargo rustc -j1 ( Cargo ) cargo rustc -j1 --keep-going . --future-incompat-report (future-incompat) . cargo-report(1) . (ENVIRONMENT) Cargo . (EXIT STATUS) o 0: Cargo . o 101: Cargo . (EXAMPLES) 1. ( ) (unsafe) : cargo rustc --lib -- -D unsafe-code 2. nightly (type) : cargo rustc --lib -- -Z print-type-sizes 3. crate-type Cargo.toml : cargo rustc --lib --crate-type lib,cdylib (SEE ALSO) cargo(1), cargo-build(1), rustc(1) CARGO-RUSTC(1)