Rust 1.43 stabilizes six APIs and adds minor changes

Share
  • April 24, 2020

In line with the release plan, the latest stable version of Rust has arrived on April 23, 2020. Rust 1.43 adds language changes and stabilized APIs, and also improves compiler performance.

SEE ALSO: Security at the root: The need for a new digital paradigm

What’s new in Rust 1.43

The language changes in v1.43 include several syntax only changes. For example, self in all fn contexts as well as type Foo: Ord are now allowed syntactically. With this stable release, the following six APIs have been moved to stable mode:

  • Once::is_completed
  • f32::LOG10_2
  • f32::LOG2_10
  • f64::LOG10_2
  • f64::LOG2_10
  • iter::once_with

As a new feature, Rust 1.43 introduces item fragments. They can be used in macros to interpolate items into the body of traits, impls, and extern blocks.

As an example, the Rust team shows this code snippet:

macro_rules! mac_trait {
    ($i:item) => {
        trait T { $i }
    }
}
mac_trait! {
    fn foo() {}
}

By using the new item fragment, it will generate the following:

trait T {
    fn foo() {}
}

The type inference around primitives has also been updated in Rust 1.43, and the compiler has received several updates for an improved performance.

SEE ALSO: Rust Survey 2019 reveals the need for more documentation

For more details, visit the Rust blog and see the release notes on GitHub.

The post Rust 1.43 stabilizes six APIs and adds minor changes appeared first on JAXenter.

Source : JAXenter