cargo-*: update page (#11327)

This commit is contained in:
Lena
2023-10-29 09:54:53 +01:00
committed by GitHub
parent 28a74a924c
commit 158b891e0f
14 changed files with 56 additions and 150 deletions

View File

@@ -1,11 +1,12 @@
# cargo rustc
> Compile a Rust package, and pass extra options to the compiler.
> Compile a Rust package. Similar to `cargo build`, but you can pass extra options to the compiler.
> See `rustc --help` for all available options.
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-rustc.html>.
- Build the package or packages defined by the `Cargo.toml` manifest file in the current working directory:
- Build the package and pass options to `rustc`:
`cargo rustc`
`cargo rustc -- {{rustc_options}}`
- Build artifacts in release mode, with optimizations:
@@ -15,11 +16,11 @@
`cargo rustc --release -- -C target-cpu=native`
- Compile with speed optimization:
- Compile with speed optimizations:
`cargo rustc -- -C opt-level {{1|2|3}}`
- Compile with [s]ize optimization (`z` also turns off loop vectorization):
- Compile with [s]ize optimizations (`z` also turns off loop vectorization):
`cargo rustc -- -C opt-level {{s|z}}`