|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Announcing Rust 1.27.1" |
| 4 | +author: The Rust Core Team |
| 5 | +--- |
| 6 | + |
| 7 | +The Rust team is happy to announce a new version of Rust, 1.27.1. 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.1 is as easy as: |
| 12 | + |
| 13 | +``` |
| 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.1][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-1271-2018-07-10 |
| 23 | + |
| 24 | +## What's in 1.27.1 stable |
| 25 | + |
| 26 | +This patch release fixes a bug in the borrow checker verification of `match` expressions. |
| 27 | +This bug was introduced in 1.26.0 with the stabilization of [match ergonomics]. We are |
| 28 | +uncertain that this specific problem actually indicated unsoundness in the borrow checker, |
| 29 | +but suspected that it might be a possibility, so decided to issue at point release. The |
| 30 | +code sample below caused a panic inside the compiler prior to this patch. |
| 31 | + |
| 32 | +```rust |
| 33 | +fn main() { |
| 34 | + let a = vec!["".to_string()]; |
| 35 | + a.iter().enumerate() |
| 36 | + .take_while(|(_, &t)| false) |
| 37 | + .collect::<Vec<_>>(); |
| 38 | +} |
| 39 | +``` |
| 40 | + |
| 41 | +1.27.1 will reject the above code with this error message: |
| 42 | + |
| 43 | +``` |
| 44 | +error[E0507]: cannot move out of borrowed content |
| 45 | + --> src/main.rs:4:30 |
| 46 | + | |
| 47 | + 4 | .take_while(|(_, &t)| false) |
| 48 | + | ^- |
| 49 | + | || |
| 50 | + | |hint: to prevent move, use `ref t` or `ref mut t` |
| 51 | + | cannot move out of borrowed content |
| 52 | +
|
| 53 | +error: aborting due to previous error |
| 54 | +``` |
| 55 | + |
| 56 | +Alongside the match ergonomics fix, a [security vulnerability] was also found in rustdoc, |
| 57 | +the standard documentation generator for Rust projects. That vulnerability is addressed by |
| 58 | +the second patch contained in this release, by removing the default search path for |
| 59 | +rustdoc plugins. This functionality will be entirely removed in Rust 1.28.0. This plugin |
| 60 | +infrastructure predates Rust 1.0 and has never been usable on stable, and has been |
| 61 | +unusable on nightly for many months. Expect to hear more about the removal in the next |
| 62 | +release: the current patch removes the default search path (instead, users must specify it |
| 63 | +explicitly), while the next release will remove the functionality entirely. |
| 64 | + |
| 65 | +[security vulnerability]: https://blog.rust-lang.org/2018/07/06/security-advisory-for-rustdoc.html |
| 66 | +[match ergonomics]: https://blog.rust-lang.org/2018/05/10/Rust-1.26.html#nicer-match-bindings |
0 commit comments