mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-05 13:05:59 +02:00
cargo-rustc: add page (#4336)
This commit is contained in:
parent
f1b8860e0a
commit
25effa9da6
1 changed files with 36 additions and 0 deletions
36
pages/common/cargo-rustc.md
Normal file
36
pages/common/cargo-rustc.md
Normal file
|
@ -0,0 +1,36 @@
|
|||
# cargo rustc
|
||||
|
||||
> Compile a Rust package, and pass extra options to the compiler.
|
||||
> 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:
|
||||
|
||||
`cargo rustc`
|
||||
|
||||
- Build artifacts in release mode, with optimizations:
|
||||
|
||||
`cargo rustc --release`
|
||||
|
||||
- Compile with architecture-specific optimizations for the current CPU:
|
||||
|
||||
`cargo rustc --release -- -C target-cpu=native`
|
||||
|
||||
- Compile with speed optimization:
|
||||
|
||||
`cargo rustc -- -C opt-level {{1|2|3}}`
|
||||
|
||||
- Compile with [s]ize optimization (`z` also turns off loop vectorization):
|
||||
|
||||
`cargo rustc -- -C opt-level {{s|z}}`
|
||||
|
||||
- Check if your package uses unsafe code:
|
||||
|
||||
`cargo rustc --lib -- -D unsafe-code`
|
||||
|
||||
- Build a specific package:
|
||||
|
||||
`cargo rustc --package {{package}}`
|
||||
|
||||
- Build only the specified binary:
|
||||
|
||||
`cargo --bin {{name}}`
|
Loading…
Add table
Reference in a new issue