Our great sponsors
-
Clippy
A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Rust does not need linting tools: as a language, it has far fewer footguns and far stricter compiler warnings, which significantly reduce the value added by the linting. You might still want to use clippy to check for stylistic and marginal correctness issues, but this is entirely optional.
Because unsafe is, by definition, for stuff the compiler can't prove correct at compile time, there is also Miri, which serves a similar role to LLVM's sanitizers and does have some overlap with them, but makes different trade-offs.
There is clippy for additional lints, rust-analyser has some lints (and refactoring tools) that are not in the compiler, there is rustfmt for formatting code or checking if code is formatted and so on
There is clippy for additional lints, rust-analyser has some lints (and refactoring tools) that are not in the compiler, there is rustfmt for formatting code or checking if code is formatted and so on
If you don't use unsafe, then the only sources of memory bugs or data races should be bugs in your dependencies that do use unsafe or compiler/std bugs that haven't been fixed yet. (There are also similar piles on the LLVM and GCC bug trackers, but I don't know how to link to whatever tags they use)
If you’re writing unsafe Rust, you might consider cargo miri and Rudra as additional static analyzers which can find bugs rustc won’t
There's a MIR Abstract interpreter project: https://github.com/facebookexperimental/MIRAI
Unless you are writing unsafe code, you generally don't need to use sanitizers. If you do write unsafe code, checking it with a sanitizer would be a great idea. Two most useful tools here I think are miri and loom.