4.3 编译器 Lint 与 Clippy
03-编译器 Lint 与 Clippy — Comprehensive Rust
1分钟内可阅读完
译文 · 基于 Comprehensive Rust
原文链接: https://google.github.io/comprehensive-rust/testing/lints.html
4.3 编译器 Lint 与 Clippy
Rust 编译器能给出出色的错误信息,以及有用的内置 lint。Clippy 提供更多 lint,并按组组织,可按项目启用。
| |
这里可以看到编译器 lint,但看不到 Clippy lint。在 playground 上运行
clippy以展示 Clippy 警告。Clippy 对其 lint 有详尽文档,并且不断新增 lint(包括默认 deny 的 lint)。注意:带有
help: ...的错误或警告可以用cargo fix或通过编辑器自动修复。