Free Download Video
General

What’s new in Rust 1.47

The unique approach of the Rust programming language results in better code with fewer compromises than C, C++, Go, and the other languages you probably use. It also gets updated regularly, often every month.

Where to download the latest Rust version

If you already have a previous version of Rust installed via rustup, you can access the latest version via the following command:

$ rustup update stable

The new features in Rust 1.47.0

Announced October 8, 2020, Rust 1.47.0 has no new language features but enhances the standard library. Quality of life and toolchain improvements as well as library stabilizations are featured in the release. Release notes have been published for the upgrade.

Specific capabilities in Rust 1.47.0 include:

  • A “const generics” feature, impacting traits on larger arrays. The feature still needs to be stabilized. Rust has lacked a way to be generic over integer values, which has caused problems with arrays. This capability is intended to address this issue and make arrays more useful.
  • An upgrade to LLVM 11 compiler infrastructure, making it the default.
  • Shorter backtraces, making it easier to find issues.
  • rustc now supports -C control-flow-guard, an option that will switch on the Control Flow Guard security capability on Windows. Other platforms ignore this flag.
  • Rustdoc now supports the Ayu theme.
  • Nine APIs in the standard library were stabilized: Ident::new_raw, Range::is_empty, RangeInclusive::is_empty, Result::as_deref, Result::as_deref_mut, Vec::leak, pointer::offset_from, f32::TAU, and f64::TAU. 

The new features in 1.46.0

Rust 1.46, announced on August 27, 2020, includes the following capabilities:

  • Several core language features now can be used in const fn, including if, if letmatch, and several others.
  • A #[track_caller] attribute, designed to improve error messages when unwrap and related functions panic, is now stable.
  • In a change to the library, std::mem::forget is now a const fn. Also in the library, two new APIs were stabilized: Option::zip and vec::Drain::as_slice.
  • For the compiler, the citylib target can be used on Apple iOS and tvOS platforms.
  • Recursively indexing into tuples no longer requires parentheses.

The new features in Rust 1.45.0

Announced on July 16, 2020, Rust 1.45 includes the following additions and improvements:

  • A fix is offered to mend some longstanding unsoundness when casting between integers and floats.
  • Stabilization is offered for function-like procedural macros in expressions, patterns, and statements. Expansion of the use of macros assists with use of the Rocket web framework for Rust.
  • Several library APIs have been stabilized, such as Arc::as_ptr, BTreeMap::remove_entry, and Span::resolved_at. The full list of APIs can be found in the Rust Blog.

The new features in Rust 1.43.1

This point release was introduced May 7, 2020, to address two regressions introduced in the 1.43.0 stable release. It also updates the OpenSSL version used by the Cargo package manager. Features include:

  • Rust 1.27 introduced support for detecting x86 CPU features in the standard library, via the is_x86_feature_detected macro. Because of an internal refactoring, Rust 1.43.0 prevented detection of features that cannot be used on stable yet, even though detecting them previously was allowed. Version 1.43.1 fixes this regression.
  • A fix is offered for broken cargo package –list command. Rust 1.43 broke support for listing files included in packages published with Cargo, when executed inside a workspace with path dependencies or unpublished versions.
  • OpenSSL, a Cargo dependency, has been updated to 1.1.1g. OpenSSL had released a security advisory but the Rust team was not able to include the fix in time for Rust 1.43.0. The team has no evidence the vulnerability could compromise Cargo users’ security.

The new features in Rust 1.43.0

Announced April 23, 2020, Rust 1.43.0 was considered a fairly minor release, with no major features introduced. Changes include:

  • Developers can use item fragments to interpolate items into the body of trait, impl, and extern blocks.
  • The type inference around primitives, references, and binary operations was improved.
  • To help integration testing, Cargo will set some new environment variables for tests to find executables.
  • In the Rust library, developers can use associated constants on floats and integers directly without having to import the module. Also, there is a new primitive module that re-exports Rust primitive types, which is useful when writing a macro and developers want to ensure types are not shadowed.
  • Several APIs in the library were stabilized: Once::is_completed, f32::LOG10_2, f32::LOG2_10, f32::LOG10_2, f64::LOG10_2, f64::LOG2_10, and iter::once_with.

The new features in Rust 1.41

The new features in Rust 1.38

Rust 1.38, released in September 2019, contains the following new features and improvements:

  • The Cargo package manager will take advantage of pipelined compilation automatically with Rust 1.38. With pipelined compilation, the compiler does not need dependencies fully built when compiling a crate. All that is needed is their metadata, such as the list of types of dependencies. Metadata is produced early in the compilation process. Some tests have shown compilation speed increases of 10 to 20 percent for optimized, clean builds of some crate graphs. 
  • Linting of some incorrect uses of mem::{unitialized, zeroed}. With this release, the rustc compiler will provide a lint for a narrow class of incorrect initializations using mem::uninitialized or mem::zeroed.
  • Extension of the #[deprecated] attribute to macros. This attribute has allowed crate authors to notify users that an item of their crate is to be deprecated and removed in a future release.
  • Developers can use std::any::type_name to get the name of a type.
  • Stabilization of a number of functions including <*const T>::cast and <*mutT>::cast.

The new features in Rust 1.37

Rust 1.37, released in August 2019, has the following new features and improvements:

  • An ability to refer to enum variants through type. Developers also can refer to enum variants with Self::Variant.
  • The cargo vendor command, previously a separate crate, is now built in to the language. The command fetches project dependencies, unpacks them into the vendordirectory, and displays the configuration snippet needed to use the vendored code during builds.
  • The rustc compiler supports profile-guided optimization, an optimizing technique for ahead-of-time compilers, via -C profile-generate and -C profile-use.
  • Developers can create unnamed const items.

The new features in Rust 1.36

Version 1.36 of the Rust systems programming language was released in July 2019. Rust 1.36 includes the following new features and enhancements:

  • The Future trait, used for declaring asynchronous work, is now stable. Asynchronous operations in Rust have been coming together in bits and pieces for several versions now, with async and await being the last important remaining pieces.
  • The alloc crate, used for managing memory, is now stable. This crate collects all of the pieces of Rust’s standard library that depend on a global memory allocation mechanism, such as Vec<T>. This way, crates that don’t use the standard library can still make use of the allocator by importing alloc separately—useful for environments where you want code sizes to be as lean as possible.
  • A new type, MaybeUninit<T>, allows you to define objects that may consist of uninitialized memory, such as a lazily allocated array. Rust’s previous mechanism for doing this was a function, mem::uninitialized, that posed many hazards in casual use. MaybeUninit<T> provides a safer way to do this that uses the constraints of Rust’s type system.
  • Non-lexical lifetimes, a feature for recent editions of Rust, has been backported to earlier editions. Non-lexical lifetimes make Rust’s borrow-checking mechanism less difficult to work with (in essence, letting you write a broader range of programs that are still valid Rust), and better able to catch problems that the borrow checker missed.

Other improvements:

  • A new implementation for the HashMap<K, V> type that runs faster and uses less memory.
  • Cargo can now run entirely offline if needed.

The new features in Rust 1.35

Version 1.35, released in May 2019, offers the following:

  • Implementation of the FnOnce, FnMut, and Fn closure traits for Box<dyn FnOnce>, Box<dyn FnMut>, and Box<dyn Fn>.
  • The dbg! macro introduced in Rust 1.32 now can be called without arguments.
  • Fn* closure traits now are implemented for Box<dyn Fn*>.
  • Stabilizations of the standard library.
  • Clippy, providing a collection of lints to catch common mistakes, added a lint, drop_bounds, which is triggered when adding a bound T: Drop to a generic function.
  • A ptr::hash function has been introduced, so developers can avoid hashing the pointed-to value of a reference and instead hash the address.
  • The value of a RefCell can be replaced through a closure. Developers can more ergonomically map and replace the current value of the cell and retrieve the old value.
  • Developers now can easily check whether a value exists in a range.
  • A number of changes have been made to the Cargo, such as the addition of a rustc-cdylib-link-arg key for build scripts to specify linker arguments for cdylib crates.

The new features in Rust 1.34

Released April 2019, Rust 1.34 includes the following new and changed features:

Related posts

Digging into the next wave of tech IPOs

admin

YC grad DigitalBrain snags $3.4M seed to streamline customer service tasks

admin

Accessibility’s nextgen breakthroughs will be literally in your head

admin