Rust programming language 1.69 release

The general-purpose programming language Rust 1.69, founded by the Mozilla project but now developed under the auspices of the independent non-profit organization Rust Foundation, has been released. The language focuses on memory safety 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 memory handling methods save the developer from errors when manipulating pointers and protect against problems that arise due to low-level memory handling, 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.

Memory safety is provided in Rust at compile time through reference checking, keeping track of object ownership, keeping track of object lifetimes (scopes), and assessing the correctness of memory access during code execution. Rust also provides protection against integer overflows, requires mandatory initialization of variable values ​​before use, handles errors better in the standard library, applies the concept of immutable references and variables by default, offers strong static typing to minimize logical errors.

Main innovations:

  • The Cargo package manager implements the detection of warnings that can be automatically resolved and the appropriate recommendations to run "cargo fix" or "cargo clippy --fix". warning: unused import: 'std::hash::Hash' --> src/main.rs:1:5 | 1 | use std::hash::hash; | ^^^^^^^^^^^^^^^ | = note: '#[warn(unused_imports)]' on by default warning: 'foo' (bin "foo") generated 1 warning (run 'cargo fix --bin "foo"' to apply 1 suggestion)
  • Added Cargo to display a recommendation to use the "cargo add" command when trying to install a library with the "cargo install" command.
  • To reduce compilation time, debugging information in build scripts has been disabled by default. If the build scripts run successfully, the change will not make any visible difference, but if it fails, the backtrace dump will contain less information. To return the old behavior to Cargo.toml add: [profile.dev.build-override] debug = true [profile.release.build-override] debug = true
  • A new portion of the API has been moved to the category of stable, including the methods and implementations of traits have been stabilized:
    • CStr::from_bytes_until_nul
    • core::ffi::FromBytesUntilNulError
  • The "const" attribute, which determines the possibility of using it in any context instead of constants, is used in functions:
    • SocketAddr::new
    • SocketAddr::ip
    • SocketAddr::port
    • SocketAddr::is_ipv4
    • SocketAddr::is_ipv6
    • SocketAddrV4::new
    • SocketAddrV4::ip
    • SocketAddrV4::port
    • SocketAddrV6::new
    • SocketAddrV6::ip
    • SocketAddrV6::port
    • SocketAddrV6::flowinfo
    • SocketAddrV6::scope_id
  • Added the ability to use true and false flags in compiler arguments.

Source: opennet.ru

Add a comment