|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Announcing Rust 1.27.2" |
| 4 | +author: The Rust Core Team |
| 5 | +--- |
| 6 | + |
| 7 | +The Rust team is happy to announce a new version of Rust, 1.27.2. Rust is a |
| 8 | +systems programming language focused on safety, speed, and concurrency. |
| 9 | + |
| 10 | +If you have a previous version of Rust installed via rustup, getting Rust |
| 11 | +1.27.2 is as easy as: |
| 12 | + |
| 13 | +```bash |
| 14 | +$ rustup update stable |
| 15 | +``` |
| 16 | + |
| 17 | +If you don't have it already, you can [get `rustup`][install] from the |
| 18 | +appropriate page on our website, and check out the [detailed release notes for |
| 19 | +1.27.2][notes] on GitHub. |
| 20 | + |
| 21 | +[install]: https://www.rust-lang.org/install.html |
| 22 | +[notes]: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1272-2018-07-20 |
| 23 | + |
| 24 | +## What's in 1.27.2 stable |
| 25 | + |
| 26 | +This patch release fixes a bug in the borrow checker verification of `match` expressions. This bug |
| 27 | +was introduced in 1.27.1 with a different bugfix for [match ergonomics]. |
| 28 | + |
| 29 | +```rust |
| 30 | +fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { |
| 31 | + match (&t, ()) { |
| 32 | + ((t,), ()) => t, |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +fn main() { |
| 37 | + let x = { |
| 38 | + let y = Box::new((42,)); |
| 39 | + transmute_lifetime(&y) |
| 40 | + }; |
| 41 | + |
| 42 | + println!("{}", x); |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +1.27.2 will reject the above code. |
| 47 | + |
| 48 | +## Concern over numerous patches to the match ergonomics feature |
| 49 | + |
| 50 | +Users have expressed concern with the frequency of patch releases to fix bugs in the match |
| 51 | +ergonomics verification by the current borrow checker on a variety of Rust's forums. There are two |
| 52 | +primary reasons for the increased rate of patch releases: significantly higher bandwidth and the |
| 53 | +age of the currently used borrow checker. |
| 54 | + |
| 55 | +With the formation of the Release team, Rust's ability to generate patch releases has |
| 56 | +greatly increased. This means that the investment from the compiler and core teams required to make |
| 57 | +a patch release is greatly reduced, which also makes such a patch release more likely to happen. |
| 58 | + |
| 59 | +The current borrow checker has been around for years now, and is beginning to show its age. The |
| 60 | +work on a better, more precise borrow checker is underway, and it has detected all of these bugs. |
| 61 | +This work is planned to be stabilized in the next few releases, so expect to hear more about it |
| 62 | +soon. |
| 63 | + |
| 64 | +Together, the lack of good maintenance on the current borrow checker and an increased capacity for |
| 65 | +releases make it feasible for us to ship patch releases on a more rapid and frequent basis. |
| 66 | + |
| 67 | +[match ergonomics]: https://blog.rust-lang.org/2018/05/10/Rust-1.26.html#nicer-match-bindings |
0 commit comments