Rust programming language 1.35 release

Took place system programming language release Rest 1.35developed by the Mozilla project. 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.

Rust's automatic memory management saves the developer from manipulating pointers and protects against problems arising from low-level memory manipulation, such as accessing a memory area after it has been freed, dereferencing null pointers, buffer overruns, etc. To distribute libraries, ensure assembly and manage dependencies, the project develops a package manager Job, which allows you to get the libraries you need for the program in one click. A repository is supported to host libraries crates.io.

All innovations:

  • traits FnOnce, fnmut и Fn implemented for heap allocated boxed types Box‹dyn FnOnce›, Box‹dyn FnMut› and Box‹dyn Fn›;
  • Added by opportunity casting closures to unsafe function pointers (unsafe fn);
  • Implemented the ability to call the macro "dbg!" without arguments to display the file name and line number in stderr without inspecting the variable, which is convenient for debugging the operation of conditional expressions;
  • Added method "copy sign» to copy a sign from one number to another;
  • Added method "contains«, allowing you to check if the specified value is in the range;
  • Added method Ref:Cell:map_split, which allow you to reflect and separate the borrowed RefCell value for different components of the borrowed data;
  • Added method RefCell::replace_with to replace the current RefCell value and return the old value as a result;
  • Added method ptr::hash for hashing a pointer or reference to an address, not to the addressed value;
  • Added method Option::copied to copy the contents of Option‹&T› or Option‹&mut T›;
  • A new portion of the API has been transferred to the category of stable, including methods stabilized
    f32::copysign,
    f64::copysign,
    RefCell::replace_with,
    RefCell::map_split,
    ptr::hash
    Range::contains,
    RangeFrom::contains,
    RangeTo::contains,
    RangeInclusive::contains,
    RangeToInclusive::contains and
    Option::copied;

  • Added a drop_bounds check to clippy (linter) that fires when a "T: Drop" binding is added to a function;
  • Added support for a new target platform to the compiler
    wasm32-unknown-wasi (interface WASI to use WebAssembly outside the browser);

  • The Rust toolkit is adapted for distributions based on the Musl standard C library.

Source: opennet.ru

Add a comment