rustc
Rust 编译器。 Rust 项目通常使用
cargo而不是直接调用rustc。 更多信息:https://doc.rust-lang.org/stable/rustc/。
- 编译二进制包(crate):
rustc
- 编译时启用优化(
s表示针对二进制大小优化;z含义相同但使用更多优化):
rustc lto opt-level=
- 编译时包含调试信息:
rustc
- 解释错误信息:
rustc --explain
- 编译时针对当前 CPU 架构启用特定优化:
rustc target-cpu=
- 显示目标列表(注意:你必须先使用
rustup添加目标才能为其编译):
rustc --print target-list
- 针对特定目标编译:
rustc --target
- 显示帮助:
rustc
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
