1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages.zh/common/cargo-check.md
Lena 554fd30c20
cargo, cargo-{build,check,doc,run,test}: add option placeholders (#15895)
Co-authored-by: Darío Hereñú <magallania@gmail.com>
2025-03-15 23:28:32 +02:00

584 B

cargo check

检查本地软件包及其所有依赖包是否有错误。 更多信息:https://doc.rust-lang.org/cargo/commands/cargo-check.html.

  • 检查当前包:

cargo {{[c|check]}}

  • 检查所有测试:

cargo {{[c|check]}} --tests

  • 检查 tests/integration_test1.rs 中的集成测试:

cargo {{[c|check]}} --test {{integration_test1}}

  • 使用 feature1feature2 功能检查当前包:

cargo {{[c|check]}} {{[-F|--features]}} {{feature1,feature2}}

  • 禁用默认功能后检测当前包:

cargo {{[c|check]}} --no-default-features