Rust programming language 1.55 release

The release of the system programming language Rust 1.55, 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:

  • The Cargo package manager implements the ability to merge duplicate errors and warnings that occur during a build. When executing commands such as "cargo test" and "cargo check --all-targets" that build a package multiple times with different options, the user is now shown a summary of the occurrence of a recurring problem, instead of displaying multiple identical warnings when rebuilding the same file. $ cargo +1.55.0 check --all-targets Checking foo v0.1.0 warning: function is never used: 'foo' --> src/lib.rs:9:4 | 9 | fn foo() {} | ^^^ | = note: '#[warn(dead_code)]' on by default warning: 'foo' (lib) generated 1 warning warning: 'foo' (lib test) generated 1 warning (1 duplicate) Finished dev [unoptimized + debuginfo] target (s) in 0.84s
  • The code for parsing floating point numbers in the standard library has been moved to use the faster and more accurate Eisele-Lemire algorithm, which has solved some of the previously observed problems with rounding and parsing numbers with a very large number of digits.
  • The ability to specify non-closed ranges in templates has been stabilized ("X.." is interpreted as a range that starts with the value of X and ends with the maximum value of the integer type): match x as u32 { 0 => println!("zero!"), 1.. => println!("positive number!"), }
  • Extended the error variants covered by the std::io::ErrorKind list (classifies errors into categories such as NotFound and WouldBlock). Previously, errors that did not fit into the existing categories fell into the ErrorKind::Other category, which also applied to errors in third-party code. There is now a separate internal category ErrorKind::Uncategorized for out-of-the-box error categories, and the ErrorKind::Other category is now restricted to errors not in the standard library (standard library functions that return io::Error no longer use the ErrorKind:: category). other).
  • A new portion of the API has been moved to the category of stable, including the methods and implementations of traits have been stabilized:
    • Bound::cloned
    • Drain::as_str
    • IntoInnerError::into_error
    • IntoInnerError::into_parts
    • MaybeUninit::assume_init_mut
    • MaybeUninit::assume_init_ref
    • MaybeUninit::write
    • array::map
    • ops::ControlFlow
    • x86::_bittest
    • x86::_bittestandcomplement
    • x86::_bittestandreset
    • x86::_bittestandset
    • x86_64::_bittest64
    • x86_64::_bittestandcomplement64
    • x86_64::_bittestandreset64
    • x86_64::_bittestandset64
  • The "const" attribute, which determines the possibility of using it instead of constants in any context, is used in the str::from_utf8_unchecked method.
  • Implemented level 64 support for the powerpcXNUMXle-unknown-freebsd platform. The third level implies basic support, but without automated testing, publishing official builds and checking the ability to build the code.

Source: opennet.ru

Add a comment