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 of 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, 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 a number of issues being uncovered, 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, 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 major edition of the language and which is scheduled for release in October.