2016-05-05 02:51:41 +01:00
|
|
|
# rustc
|
|
|
|
|
|
|
|
> The Rust compiler.
|
2016-05-05 18:01:04 +01:00
|
|
|
> Processes, compiles and links Rust language source files.
|
2019-05-23 11:56:50 +01:00
|
|
|
> More information: <https://doc.rust-lang.org/rustc>.
|
2016-05-05 02:51:41 +01:00
|
|
|
|
|
|
|
- Compile a single file:
|
|
|
|
|
|
|
|
`rustc {{file.rs}}`
|
|
|
|
|
|
|
|
- Compile with high optimization:
|
|
|
|
|
|
|
|
`rustc -O {{file.rs}}`
|
|
|
|
|
|
|
|
- Compile with debugging information:
|
|
|
|
|
|
|
|
`rustc -g {{file.rs}}`
|
2020-09-11 01:31:08 +01:00
|
|
|
|
|
|
|
- Compile with architecture-specific optimizations for the current CPU:
|
|
|
|
|
|
|
|
`rustc -C target-cpu=native {{path/to/file.rs}}`
|
|
|
|
|
|
|
|
- Display architecture-specific optimizations for the current CPU:
|
|
|
|
|
|
|
|
`rustc -C target-cpu=native --print cfg`
|
|
|
|
|
|
|
|
- Display target list:
|
|
|
|
|
|
|
|
`rustc --print target-list`
|
|
|
|
|
|
|
|
- Compile for a specific target:
|
|
|
|
|
|
|
|
`rustc --target {{target_triple}} {{path/to/file.rs}}`
|