The distinctive tactic of the Rust programming language results in much better code with fewer compromises than C, C++, Go, and the other languages you most likely use. It also will get updated often, typically every single month.

Where to obtain the latest Rust model

If you already have a prior model of Rust set up by using rustup, you can entry the latest model by using the subsequent command:

$ rustup update stable

The new capabilities in Rust one.50.

Posted February eleven, 2021, Rust one.50. increases array indexing, expands protected entry to union fields, and adds to the regular library. Certain enhancements incorporate:

  • For const-generic array indexing, this launch carries on a development towards stable const generics, introducing implementations of ops::Index and IndexMut for arrays [T N] for any size of Const N. The indexing operator [ ] already worked on arrays by the compiler, but at the type degree, arrays did not truly put into practice the library characteristics right up until now. Also, stable use of const values in array repetition is formally acknowledged.
  • Harmless assignments to ManuallyDrop union fields are permitted.
  • A market for File on Unix platforms is now permitted. With this function, some sorts in Rust have limitations on what is viewed as a legitimate benefit, which might not go over the assortment of probable memory values. Any remaining legitimate benefit is referred to as a market, with this room usable for type format optimizations. On Unix platforms, Rust’s File is made of the system’s file integer descriptor this comes about to have a probable market since it are unable to be -one! Method phone calls that return a file descriptor use -one to reveal an mistake happened, so it is in no way probable for -one to be a real file descriptor. Starting with Rust one.50, this is additional to the type definition so it can be utilised in format optimizations, much too. It follows that Possibility now will have the same measurement as File.
  • For Cargo, a [rustc-workspace-wrapper] solution has been additional, to established a wrapper to execute rather of rustc, for workspace customers only. Also, the --workspace flag has been additional to the cargo update command.
  • Nine new stable capabilities have been additional to the library: bool::then, btree_map::Entry::or_insert_with_critical, f32::clamp, f64::clamphash_map::Entry::or_insert_with_critical, Ord::clamp, RefCell::consider, slice::fill, and UnsafeCell::get_mut.
  • Also in the library, many existing capabilities have been made const: IpAddr::is_ipv4, IpAddr::is_ipv6, Structure::measurement, Structure::align, Structure::from_measurement_align, pow for all integer sorts, checked_pow for all integer sorts, saturating_pow for all integer sorts, wrapping_pow for all integer sorts, up coming_ability_of_two for all unsigned integer sorts, and checked_ability_of_two for all unsigned integer sorts.

The new capabilities in Rust one.49.

Declared December 31, 2020, Rust one.49. designates sixty four-little bit Arm Linux as a Tier one target, consequently delivering the greatest support guarantee, with the whole examination suite run on this platform on every single alter merged in the compiler. This support is expected to reward workloads spanning from embedded systems to servers and desktops. Prebuilt binaries also are out there. This marks the initial time a non-x86 target has attained Tier one support. The Rust progress team hopes to convey a lot more platforms into this tier in the potential.

Also with Rust one.49., sixty four-little bit Arm for MacOS and Home windows reach Tier two support. Developers can assume these two targets to have prebuilt binaries installable from rustup. Tier two targets are certain to develop, and prebuilt binaries are provided. Nonetheless, the Rust team does not execute the examination suite on individuals platforms. Created binaries might not function and may have bugs.

Other additions, enhancements, and alterations in Rust one.49.: