The Rust team has officially released a new version of Rust 1.55.0. If you have previously installed a previous version of Rust via rustup, you can upgrade to the latest version by running the following command.

1
rustup update stable

Updates in the 1.55.0 stable release include

Cargo repeats compiler error

In past versions, when running cargo test, cargo check --all-targets, or similar commands to build the same Rust crate in multiple configurations, errors and warnings may be repeated because rustc runs in parallel and all display the same warnings.

For example, in 1.54.0, output like this is common.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$ cargo +1.54.0 check --all-targets
    Checking foo v0.1.0
warning: function is never used: `foo`
 --> src/lib.rs:9:4
  |
9 | fn foo() {}
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: 1 warning emitted

warning: function is never used: `foo`
 --> src/lib.rs:9:4
  |
9 | fn foo() {}
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.10s

In version 1.55, this behavior has been adjusted to repeat and print a report at the end of compilation:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
$ cargo +1.55.0 check --all-targets
    Checking foo v0.1.0
warning: function is never used: `foo`
 --> src/lib.rs:9:4
  |
9 | fn foo() {}
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: `foo` (lib) generated 1 warning
warning: `foo` (lib test) generated 1 warning (1 duplicate)
    Finished dev [unoptimized + debuginfo] target(s) in 0.84s

Faster and more accurate floating point resolution

The floating-point parsing implementation of the standard library has been updated to use the Eisel-Lemire algorithm, which brings speedups and improved correctness. In the past, certain edge cases could not be parsed, but this has now been fixed.

std::io::ErrorKind variant has been updated

std::io::ErrorKind is a #[non_exhaustive] enumeration that classifies errors into portable categories, such as NotFound or WouldBlock. Rust code that has std::io::Error can call the kind method to get std::io::ErrorKind and match on top of that to handle a particular error.

Not all errors are categorized as ErrorKind values; some errors are not categorized and are placed in a catch-all variant. In previous versions of Rust, unclassified errors used ErrorKind::Other; however, user-created std::io::Error values also typically use ErrorKind::Other. In 1.55, uncategorized errors now use the internal variant ErrorKind::Uncategorized; this allows ErrorKind::Other to be used exclusively to construct std::io::Error values that do not come from the standard library.

Open range mode has been added

Rust 1.55 stabilizes the use of open ranges in schemas:

1
2
3
4
match x as u32 {
      0 => println!("zero!"),
      1.. => println!("positive number!"),
}

Stable API

The following methods and implementations of properties are stabilized:

  • [Bound::cloned]( )
  • [Drain::as_str]( )
  • [IntoInnerError::into_error]( )
  • [IntoInnerError::into_parts]( )
  • [MaybeUninit::assume_init_mut]( )
  • [MaybeUninit::assume_init_ref]( )
  • [MaybeUninit::write]( )
  • [array::map]( )
  • [ops::ControlFlow]( )
  • [x86::_bittest]( )
  • [x86::_bittestandcomplement]( )
  • [x86::_bittestandreset]( )
  • [x86::_bittestandset]( )
  • [x86_64::_bittest64]( )
  • [x86_64::_bittestandcomplement64]( )
  • [x86_64::_bittestandreset64]( )
  • [x86_64::_bittestandset64]( )

The formerly stable function is now const

  • [str::from_utf8_unchecked]( )

Additional changes in the Rust 1.55.0 release can be viewed at: https://blog.rust-lang.org/2021/09/09/Rust-1.55.0.html