The latest version of the programming language Rust is now available. Rust 1.54 introduces a few new stable features.
One new update is that attributes can invoke function-like macros. An example use case is including documentation from other files into comments. “For example, if your project’s README represents a good documentation comment, you can use include_str! To directly incorporate the contents,” the Rust team explained in a post. According to the team, there were previously some workarounds that would allow for this functionality, but this makes it more ergonomic.
Another new addition is the move to stable for several intrinsics for the wasm32 platform. Unlike the x86 and x86_64 intrinsics that are already stabilized, these don’t have a safety requirement where they can only be called if the appropriate target feature is enabled. This is because WebAssembly validates code safely before it is executed, so instructions are guaranteed to either be decoded correctly or not at all.
In addition, the incremental compilation has been re-enabled by default in Rust 1.54 after previously being turned off by default in Rust 1.52.1. In Rust 1.52, additional validation was added when loading incremental compilation data, resulting in several uncovered issues, leading to the team deciding to leave it disabled by default in the 1.52.1 patch. Since that time, the team and contributors have worked to resolve some of those issues. Some fixes were introduced in Rust 1.53, and the majority are now available in Rust 1.54.
There are still two known issues, but because there is a lack of automated crash reporting, the team is unsure of the full extent of the impact of those remaining issues. “However, based on the feedback we received from users affected by the 1.52 release, we believe the remaining issues to be rare in practice. Therefore, the incremental compilation has been re-enabled in this release,” the team wrote. Rust 1.54 is in advance of the upcoming release of Rust 2021, which is the third primary edition of the language and is scheduled for release in October.