Yesterday, the Rust team announced the release of Rust 1.35.0. This release highlights the implementation of Fn* closure traits for Box<dyn Fn*>. Additionally it has features like coercing closures which are extended to unsafe fn pointers, dbg! macro can now be called without passing any arguments, a number of APIs have become stable and many more.
Key features explained in brief:
In Rust 1.35.0, the FnOnce, FnMut, and the Fn traits are now implemented for Box<dyn FnOnce>, Box<dyn FnMut>, and Box<dyn Fn> respectively. This allows users to use boxed functions in places where a function is to be implemented. It is also now possible to directly call Box<dyn FnOnce> objects.
In the earlier versions, it was possible to coerce closures which do not capture from the environment, into function pointers only . With this release, coercing closures has been extended to ‘unsafe’ function pointers also.
‘dbg!()’ macro allows to quickly inspect the value of some expression with context. Now, users can call dbg!() without passing any arguments. This is useful in tracing what branch your application will take.
In 1.35.0, a number of APIs have become stable. Few new implementations and other changes have also been made. Some are mentioned below:
To know more about the changes in Library, head over to the release notes page.
Clippy is a collection of lints to catch common mistakes and improve the Rust code. In this release of Rust, a new lint ‘drop_bounds’ has been added. Also Clippy has split the lintredundant_closure into redundant_closure and redundant_closure_for_method_calls.
To know more about the changes in Cargo, head over to the release notes page.
Read more about the Rust 1.35.0 announcement on the official Rust blog.
Rust’s recent releases 1.34.0 and 1.34.1 affected from a vulnerability that can cause memory unsafety
Rust 1.34 releases with alternative cargo registries, stabilized TryFrom and TryInto, and more
Rust shares roadmap for 2019