Rust programming language 1.43 release

Published system programming language release Rest 1.43founded 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:

  • Macros provide the ability to use fragments of elements to turn them into code for traits (trait), implementations (impl) or external blocks. For example:

    macro_rules! mac_trait {
    ($i:item) => {
    trait T { $i }
    }
    }
    mac_trait! {
    fn foo() {}
    }

    Will lead to generation:

    trait T {
    fn foo() {}
    }

  • Improved type detection of primitives, references and binary operations.
    For example, the following code, which previously caused an error, will now be able to compile (Rust now correctly determines that 0.0 and &0.0 must be of type f32):

    let n: f32 = 0.0 + &0.0;

  • A new environment variable CARGO_BIN_EXE_{name} has been added to Cargo, which is set when building integration tests and allows you to determine the full path to the executable file defined in the β€œ[[bin]]” section of the package.
  • If statements are allowed to use attributes such as "#[cfg()]".
  • The library provides the ability to use associated constants directly for integer and fractional types, without importing a module. For example, you can immediately write u32::MAX or f32::NAN without first specifying β€œuse std::u32” and β€œuse std::f32”.
  • Added a new module primitive, which re-exports Rust primitive types, for example when you need to write a macro and make sure the types aren't hidden.
  • A new portion of the API has been transferred to the category of stable, including stabilized

    Once::is_completed,
    f32::LOG10_2,
    f32::LOG2_10,
    f64::LOG10_2,
    f64::LOG2_10 and
    iter::once_with.

Source: opennet.ru

Add a comment