⚙️ Rust 1.67.0 Fixes Rounding

Tom Smykowski
3 min readJan 27, 2023

In October 2022 I was reporting about Rust 1.64 release that made the compiler 10–20% faster on Windows. In December, I also found some interesting Rust projects for you, and at the beginning of this year I wrote the first part of the series of articles about Rust traits.

Today, we will see what happened since October. It is a special occasion because yesterday Rust 1.67.0 was released.

Fixed Rounding

As John Bartholomew reported, Rust used inconsistent rounding rules. Specifically the report describes a situation when halves of numbers are rounded inconsistently.

[Paragraph below was updated to properly describe the round to even method and the bug with rounding 0.5]

The standard way of rounding in Rust is to round halves to even numbers, so 1.5 becomes 2, 3.5 becomes 4, while 2.5 becomes 2. But it was not always the case. Rust rounded 0.5 to 1 rather to 0 (closest even number).

The bug has been fixed in Rust 1.67.0.

Elaborate supertrait obligations when deducing closure signatures

--

--

Tom Smykowski

Software Engineer & Tech Editor. Top 2% on StackOverflow, 3mil views on Quora. Won Shattered Pixel Dungeon.