Rust 1.68 arrives with support improvements and more

unwind

Rust is a compiled programming language that supports pure functional, procedural, imperative, and object-oriented programming.

Recently the release of the new version of the programming language “Rust 1.68” was announced. For those unfamiliar with Rust, you should know that this programming language was founded by the Mozilla project, but now developed under the auspices of the independent non-profit Rust Foundation.

The languagee focuses on memory security 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 management methods save the developer from errors when manipulating pointers and protect against problems that arise due to low-level memory manipulation, such as accessing an area of ​​memory after it has been freed, dereferencing null pointers, memory overflows, etc. buffer etc To distribute libraries, provide builds, and manage dependencies, the project develops the Cargo package manager.

Rust also provides protection against integer overflows, requires mandatory initialization of variable values ​​before use, better handles errors in the standard library, enforces the concept of immutable variables and references by default, offers strong static typing to minimize logical errors.

Main new features of Rust 1.68

In this new version that comes from Rust 1.68, we can find that the support for the Sparse protocol has been stabilized in the Cargo package manager and the crates.io repository, which defines a new way of working with an index that reflects the available versions of all existing packages in the repository.

The new protocol makes it possible to significantly increase the speed of working with crates.io and solve scaling problems with a further increase in the number of packages in the repository.

To reduce delays that result from downloading an index full, sparse, instead of accessing the index via Git, download directly via HTTPS only the index data necessary, covering the dependencies of a particular project. To return index data, a new service index.crates.io is involved.

By default, the new protocol is planned for use in the Rust 1.70 branch, and before that, to enable it, you can set the environment variable "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse» or add the parameter 'protocol=sparse' to file .cargo/config.toml.

Another of the changes that stands out is thatand added the macro » pin! « which allows you to create a Pin<&mut T> structure from the "T" expression with local pinning of its state (unlike Box::pin it does not allocate memory on the heap, but binds at the stack level).

In addition to that, we can also find that a default memory allocation error handler is proposed, which is used when using the standard mapping package.

Applications that only enable alloc (not std) will now call the controller "panic!" in case of memory allocation failures, which can optionally be intercepted with "#[panic_handler]". Programs that use the std library will still print error information to stderr and fail.

Of the other changes that stand out:

  • A new part of the API has been moved to stable, including methods and trait implementations that have been stabilized
  • The "const" attribute, which determines the possibility of using it in any context instead of constants, is used in the VecDeque::new.
  • The Android platform now requires at least NDK r25 (API 19), i.e. The minimum supported Android version has been raised to 4.4 (KitKat).
  • The third level of support for the Sony PlayStation Vita platform (armv7-sony-vita-newlibeabihf) has been implemented.
  • The third level involves basic support, but without automated testing, publishing official builds, and verifying the compilability of the code.

If you are interested in knowing more about it, you can check the details in the following link.

Finally, for those who are Interested in upgrading from a previous version of Rust installed via rustup, you can get the new version of Rust 1.68.0 with:

rustup update stable


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.