Rust 2018 to be Out

New release brings together all the improvements and changes prepared in the last three years
10 December 2018   780

The Rust language team has released update 1.31. They also named this release Rust 2018. It brings together all the improvements and changes prepared in the last three years, and updated the documentation, support of the working environments and the website. And the first stable version of the language, Rust 1.0, was named by the developers Rust 2015 to clearly indicate the difference between the two major versions of the language.

In projects on Rust, you can switch the used version of the language, 2015 or 2018. So you can achieve maximum compatibility of the project with the version of Rust.

The new version differs from Rust 2015 with several improvements:

  • Non-Lexical Lifetimes. Rust developers modified the borrowing test. It helps to prevent hanging links and other problems with memory management. In Rust 2018, borrowing verification has become smarter: it now tracks the moment when a variable stops using data, and does not block other requests for this data after that.
  • System of modules. Changed the work paths that are accessed in namespaces. Now most often the use of extern crate is not required. Absolute paths begin with the name of the crate, where the crate keyword refers to the current crate.

Rust 1.42 to be Rolled Out

New version of Mozilla-backed programming language gives a lot of changes and improvements, for example subslice patterns
16 March 2020   167

Rust programming language received new update - version 1.42 has been published. The language is focused on safe work with memory, provides automatic memory management and provides means to achieve high concurrency of tasks, without using the garbage collector and runtime.

Some of the new features:

  • Added support for templates for matching parts of slices (dynamic arrays, slice). If exact comparisons were previously allowed, now the ability to use constructions with the label ".." to cover the remaining elements of the array has been added. For instance:
  • Added a new macro "matches!", Which accepts an expression and a template at the input, and returns "true" if the template matches the expression. The template may use operations "|" and "if".
  • Panic messages displayed when the Option and Result types are used incorrectly now show line numbers with a link to the code that made the problem call, rather than links to the call implementation code in libcore. For example, a change affects the call to unwrap and expect over Option :: None, or crashes when using unwrap_err, expect, expect_err and similar methods for the Result type.
  • Cargo package manager provides automatic substitution of "proc_macro crate" into the "extern" block for packages with procedural macros. This change allows the use directive to be applied to procedural macros without the need to specify extern crate proc_macro in the code. For example, if the program uses the string "use proc_macro :: TokenStream;", then the code will now remain working if "extern crate proc_macro;" is removed from it.
  • Extended features of the standard library. Iter :: Empty <T> added support for Send and Sync for any T. values. Calls :: :: map_unchecked, map_unchecked_mut} eliminated the need to return a type value for the implementation of "Sized". Io :: Cursor implements PartialEq and Eq. The "const" attribute, which determines whether it can be used in any context instead of constants, is used for the Layout :: new method.
  • A new portion of the API has been transferred to the category of stable, including CondVar :: wait_while, CondVar :: wait_timeout_while, DebugMap :: key, DebugMap :: value, ManuallyDrop :: take, ptr :: slice_from_raw_parts_mut and ptr :: slice_from_raw_parts.
  • The Error :: description method is deprecated.
  • Provided in the second level of support for armv7a-none-eabi and riscv64gc-unknown-linux-gnu platforms. Support for the standard library for the riscv64gc-unknown-linux-gnu platform is provided. Apple's 32-bit platforms have been downgraded to a third level of support, which implies basic support, but without automated testing and publication of official assemblies. The decrease in support level is due to the termination of support by Apple 32-bit platforms.

Get more at the official blog.