Born Clippy: Rust 1.52.0 delivers fixes for tooling support

Rust Foundation

Rust 1.52.0 came out today, with enhancements to Clippy, stabilised APIs, and a number of other minor updates.

The team says the most significant changes in this release are enhancements to tooling support for Clippy, the Rust compiler’s collection of lints intended to catch common mistakes and improve the resulting Rust code.

Previously, running cargo check followed by cargo clippy would not actually result in Clippy being run, as a result of the build caching in Cargo not differentiating between the two. This anomaly was fixed in Rust 1.52.0, which means developers will find the expected behaviour irrespective of which order they run the two commands.

The release also adds the unsafe_op_in_unsafe_fn lint, which checks whether the unsafe code in an unsafe fn is wrapped in an unsafe block. This lint is currently allowed by default, but may become a warning or hard error in a future edition.

Meanwhile, Rustdoc lints are now treated as a tool lint, meaning such lints are now prefixed with rustdoc:: . Using the old style is still allowed, although this will become a warning in a future release. Rustdoc now supports argument files, and generates smart punctuation for documentation.

Also in 1.52.0, a number of APIs were stabilised, including Arguments::as_str and several character handling methods such as char::MAX and char::UNICODE_VERSION.

Some previously stable APIs are now const, including char::len_utf8 and char::len_utf16.

Other changes include an update in the default LLVM to LLVM 12. Developers can also now pass multiple filters to tests. Rustup also now distributes PDB symbols for the std library on Windows. This allows developers to see std symbols when debugging.

For full details of all the changes in Rust 1.52.0, you can check out the Rust Blog and the Rust 1.52.0 release notes.