Rust programming language 1.52 release

The release of the system programming language Rust 1.52, founded by the Mozilla project, but now developed under the auspices of the independent non-profit organization Rust Foundation, has been published. The language focuses on safe memory management, provides automatic memory management, and provides the means to achieve high job parallelism while avoiding the use of a garbage collector and runtime (runtime is reduced to basic initialization and maintenance of the standard library).

Rust's automatic memory management saves the developer from errors when manipulating pointers and protects against problems that arise due to low-level memory manipulation, such as accessing a memory area after it has been freed, dereferencing null pointers, buffer overruns, etc. To distribute libraries, provide builds and manage dependencies, the project develops the Cargo package manager. The crates.io repository is supported for hosting libraries.

Main innovations:

  • Removed binding to the order of execution of the β€œcargo check” and β€œcargo clippy” commands. Previously, calling "cargo clippy" after "cargo check" did not launch the clippy utility (linter) due to the lack of cache separation for these check modes. Now this problem is solved and the order in which β€œcargo clippy” and β€œcargo check” are called no longer matters.
  • A new portion of the API has been transferred to the category of stable, including methods stabilized:
    • Arguments::as_str
    • char::MAX
    • char::REPLACEMENT_CHARACTER
    • char::UNICODE_VERSION
    • char::decode_utf16
    • char::from_digit
    • char::from_u32_unchecked
    • char::from_u32
    • slice::partition_point
    • str::rsplit_once
    • str::split_once
  • The "const" attribute, which determines the possibility of using it in any context instead of constants, is used in methods:
    • char::len_utf8
    • char::len_utf16
    • char::to_ascii_uppercase
    • char::to_ascii_lowercase
    • char::eq_ignore_ascii_case
    • u8::to_ascii_uppercase
    • u8::to_ascii_lowercase
    • u8::eq_ignore_ascii_case
  • Added lint check unsafe_op_in_unsafe_fn to determine whether unsafe code used in unsafe functions is framed by unsafe blocks.
  • It is allowed to cast mutable pointers to arrays into the form of pointers to the type of the array element. let mut x: [usize; 2] = [0, 0]; let p = &mut x as *mut usize; let p = &mut x as *const usize;
  • 9 new checks have been added to clippy (linter).
  • The cargo package manager now supports the β€œmanifest_path” field in JSON for packages. Added support for specifying license information in SPDX 3.11 format to the crates.io repository.
  • It is allowed to specify multiple filters when running tests, for example running "cargo test - foo bar" will run all tests matching the masks "foo" and "bar".
  • The default LLVM toolkit has been updated to LLVM 12.
  • The third level of support has been implemented for the s390x-unknown-linux-musl, riscv32gc-unknown-linux-musl, riscv64gc-unknown-linux-musl and powerpc-unknown-openbsd platforms. The third level involves basic support, but without automated testing, publishing official builds, or checking whether the code can be built.

Source: opennet.ru

Add a comment