|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Announcing Rust 1.14.0" |
| 4 | +author: The Rust Core Team |
| 5 | +--- |
| 6 | + |
| 7 | +The Rust team is happy to announce the latest version of Rust, 1.14.0. Rust is a |
| 8 | +systems programming language focused on safety, speed, and concurrency. |
| 9 | + |
| 10 | +As always, you can [install Rust 1.14.0][install] from the appropriate page on our |
| 11 | +website, and check out the [detailed release notes for 1.14.0][notes] on GitHub. |
| 12 | +1230 patches were landed in this release. |
| 13 | + |
| 14 | +[install]: https://www.rust-lang.org/install.html |
| 15 | +[notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1140-2016-12-22 |
| 16 | + |
| 17 | +### What's in 1.14.0 stable |
| 18 | + |
| 19 | +One of the biggest features in Rust 1.14 isn't actually in the language or |
| 20 | +compiler: the [rustup tool has reached a 1.0 release][rustup], and is now the |
| 21 | +recommended way to install Rust from the project directly. Rustup does a bit |
| 22 | +more than just install Rust: |
| 23 | + |
| 24 | +> rustup installs The Rust Programming Language from the official release |
| 25 | +> channels, enabling you to easily switch between stable, beta, and nightly |
| 26 | +> compilers and keep them updated. It makes cross-compiling simpler with binary |
| 27 | +> builds of the standard library for common platforms. And it runs on all |
| 28 | +> platforms Rust supports, including Windows. |
| 29 | +
|
| 30 | +[rustup]: https://internals.rust-lang.org/t/beta-testing-rustup-rs/3316/203 |
| 31 | + |
| 32 | +We had [a previous post about Rustup][prev] back in May. You can learn more |
| 33 | +about it there, or by checking it out [on |
| 34 | +GitHub](https://github.com/rust-lang-nursery/rustup.rs). |
| 35 | + |
| 36 | +[prev]: https://blog.rust-lang.org/2016/05/13/rustup.html |
| 37 | + |
| 38 | +Another exciting feature is [experimental support for WebAssembly][wasm] as a |
| 39 | +target, `wasm32-unknown-emscripten`. It is still early days, and there's a lot |
| 40 | +of bugs to shake out, so please give it a try and report them! To give you a |
| 41 | +small taste of how it works, once you have [emscripten] installed, compiling |
| 42 | +some Rust code to WebAssembly is as easy as: |
| 43 | + |
| 44 | +```bash |
| 45 | +$ rustup target add wasm32-unknown-emscripten |
| 46 | +$ echo 'fn main() { println!("Hello, Emscripten!"); }' > hello.rs |
| 47 | +$ rustc --target=wasm32-unknown-emscripten hello.rs |
| 48 | +$ node hello.js |
| 49 | +``` |
| 50 | + |
| 51 | +[wasm]: https://users.rust-lang.org/t/compiling-to-the-web-with-rust-and-emscripten/7627 |
| 52 | +[emscripten]: http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html |
| 53 | + |
| 54 | +The community has been doing interesting, experimental work in this area: see |
| 55 | +[Jan-Erik's slides] for the workshop he ran at [Rust Belt Rust] for some |
| 56 | +examples, or check out [Tim's example of the classic TodoMVC project][todomvc]. |
| 57 | +This implementation builds off of his [webplatform |
| 58 | +crate](https://crates.io/crates/webplatform), which exposes the DOM to Rust. |
| 59 | + |
| 60 | +[Jan-Erik's slides]: http://www.hellorust.com/emscripten/ |
| 61 | +[Rust Belt Rust]: http://www.rust-belt-rust.com/sessions/ |
| 62 | +[todomvc]: http://timryan.org/rust-todomvc/ |
| 63 | + |
| 64 | +Speaking of platforms, a large number of platforms have gained additional |
| 65 | +support: |
| 66 | + |
| 67 | +For `rustc`: |
| 68 | + |
| 69 | +* `mips-unknown-linux-gnu` |
| 70 | +* `mipsel-unknown-linux-gnu` |
| 71 | +* `mips64-unknown-linux-gnuabi64` |
| 72 | +* `mips64el-unknown-linux-gnuabi64` |
| 73 | +* `powerpc-unknown-linux-gnu` |
| 74 | +* `powerpc64-unknown-linux-gnu` |
| 75 | +* `powerpc64le-unknown-linux-gnu` |
| 76 | +* `s390x-unknown-linux-gnu` |
| 77 | + |
| 78 | +And for `std`: |
| 79 | + |
| 80 | +* `arm-unknown-linux-musleabi` |
| 81 | +* `arm-unknown-linux-musleabihf` |
| 82 | +* `armv7-unknown-linux-musleabihf` |
| 83 | + |
| 84 | +If you're using one of these platforms, follow the instructions on the website |
| 85 | +to install, or add the targets to an existing installation with |
| 86 | +`rustup target add`. |
| 87 | + |
| 88 | +These platforms are all 'tier 2', please see our page on [platform support] for |
| 89 | +more details. |
| 90 | + |
| 91 | +[platform support]: https://forge.rust-lang.org/platform-support.html |
| 92 | + |
| 93 | +Just like how the community is doing interesting work on the WebAssembly |
| 94 | +target, there's also neat things going on with increasing Rust's target support |
| 95 | +beyond what's listed above. [xargo] allows for easy cross-compilation of Rust |
| 96 | +to bare-metal targets. If you're writing an operating system in Rust, or doing |
| 97 | +something interesting on a microcontroller, xargo can make your life a lot |
| 98 | +simpler. |
| 99 | + |
| 100 | +[xargo]: https://github.com/japaric/xargo |
| 101 | + |
| 102 | + |
| 103 | +The landing of MIR over the last few releases means that a [number of |
| 104 | +improvements to compile times] have landed, with more coming in the future. |
| 105 | + |
| 106 | +[number of improvements to compile times]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#compile-time-optimizations |
| 107 | + |
| 108 | +In the language, one small improvement has landed: support for [RFC 1492]. This small |
| 109 | +addition lets you use `..` in more places. Previously, say you had a struct like this: |
| 110 | + |
| 111 | +```rust |
| 112 | +struct Point { |
| 113 | + x: i32, |
| 114 | + y: i32, |
| 115 | + z: i32, |
| 116 | +} |
| 117 | +``` |
| 118 | + |
| 119 | +In any context where you're doing a pattern match, you could use `..` to ignore the |
| 120 | +parts you don't care about. For example: |
| 121 | + |
| 122 | + |
| 123 | +```rust |
| 124 | +let p = Point { x: 0, y: 1, z: 2 }; |
| 125 | + |
| 126 | +match p { |
| 127 | + Point { x, .. } => println!("x is {}", x), |
| 128 | +} |
| 129 | +``` |
| 130 | + |
| 131 | +The `..` ignores `y` and `z`. |
| 132 | + |
| 133 | +Consider a similar `Point`, but as a tuple struct: |
| 134 | + |
| 135 | +```rust |
| 136 | +struct Point(i32, i32, i32); |
| 137 | +``` |
| 138 | + |
| 139 | +Previously, you could use `..` to ignore all three elements: |
| 140 | + |
| 141 | +```rust |
| 142 | +let p = Point(0, 1, 2); |
| 143 | + |
| 144 | +match p { |
| 145 | + Point(..) => println!("found a point"), |
| 146 | +} |
| 147 | +``` |
| 148 | + |
| 149 | +But you could not use it to only ignore parts of the tuple: |
| 150 | + |
| 151 | +```rust |
| 152 | +let p = Point(0, 1, 2); |
| 153 | + |
| 154 | +match p { |
| 155 | + Point(x, ..) => println!("x is {}", x), |
| 156 | +} |
| 157 | +``` |
| 158 | + |
| 159 | +This was an inconsistency, and so with RFC 1492 stabilized, compiles fine as of |
| 160 | +this release. This applies to more situations than tuples; please see [the |
| 161 | +RFC][RFC 1492] for more details. |
| 162 | + |
| 163 | +[RFC 1492]: https://github.com/rust-lang/rfcs/blob/master/text/1492-dotdot-in-patterns.md |
| 164 | + |
| 165 | +#### Library stabilizations |
| 166 | + |
| 167 | +There have been a number of additions to the standard library, but they don't |
| 168 | +fit into particularly nice categories for this release. Here's the highlights: |
| 169 | + |
| 170 | +* [`println!()`, with no arguments, prints newline][36825]. |
| 171 | + Previously, an empty string was required to achieve the same. |
| 172 | +* [`Wrapping` impls standard binary and unary operators on references, as well |
| 173 | + as the `Sum` and `Product` iterators][37356], making references to these |
| 174 | + types easier to use. |
| 175 | +* [Implement `From<Cow<str>> for String` and `From<Cow<[T]>> for |
| 176 | + Vec<T>`][37326]. These implementations make sense, but were not yet added. |
| 177 | +* [Expand `.zip()` specialization to `.map()` and `.cloned()`][37230] for improved performance. |
| 178 | +* [Implement `RefUnwindSafe` for atomic types][37178], as these types are |
| 179 | + "unwind safe," though that wasn't obvious at first. |
| 180 | +* [Specialize `Vec::extend` to `Vec::extend_from_slice`][37094] for performance gains. |
| 181 | +* [Don't reuse `HashMap` random seeds][37470]. This helps to mitigate one type |
| 182 | + of DDoS attack. |
| 183 | +* [The internal memory layout of `HashMap` is more cache-friendly, for |
| 184 | + significant improvements in some operations][36692] |
| 185 | +* [Impl `Add<{str, Cow<str>}>` for `Cow<str>`][36430]. We already support `Add` |
| 186 | + for other string types, so not having it on `Cow` is inconsistent. |
| 187 | + |
| 188 | +[36825]: https://github.com/rust-lang/rust/issues/36825 |
| 189 | +[37356]: https://github.com/rust-lang/rust/issues/37356 |
| 190 | +[37326]: https://github.com/rust-lang/rust/issues/37326 |
| 191 | +[37230]: https://github.com/rust-lang/rust/issues/37230 |
| 192 | +[37178]: https://github.com/rust-lang/rust/issues/37178 |
| 193 | +[37094]: https://github.com/rust-lang/rust/issues/37094 |
| 194 | +[37470]: https://github.com/rust-lang/rust/issues/37470 |
| 195 | +[36692]: https://github.com/rust-lang/rust/issues/36692 |
| 196 | +[36430]: https://github.com/rust-lang/rust/issues/36430 |
| 197 | + |
| 198 | +See the [detailed release notes][notes] for more. |
| 199 | + |
| 200 | +#### Cargo features |
| 201 | + |
| 202 | +As for Cargo, [RFC 1721] has been implemented. Cargo will now pass along the |
| 203 | +values printed by `rustc --print cfg` to build scripts. The motivation for this |
| 204 | +feature is that Cargo can now compile objects for statically linking against |
| 205 | +the msvcrt on the MSVC platform. |
| 206 | + |
| 207 | +[RFC 1721]: https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md |
| 208 | + |
| 209 | +Cargo now works properly [with a read-only `CARGO_HOME`][3259]. |
| 210 | + |
| 211 | +Finally, Cargo will [ignore the `panic` configuration for the `test` and |
| 212 | +`bench` profiles][3175]. This is important because the test runner relies on |
| 213 | +panics counting as failing tests, and so with `panic=abort`, a failing test |
| 214 | +would abort the entire test suite. |
| 215 | + |
| 216 | +[3259]: https://github.com/rust-lang/cargo/issues/3259 |
| 217 | +[3175]: https://github.com/rust-lang/cargo/issues/3175 |
| 218 | + |
| 219 | +See the [detailed release notes][notes] for more. |
| 220 | + |
| 221 | +### Contributors to 1.14.0 |
| 222 | + |
| 223 | +We had 144 individuals contribute to 1.14.0. Thank you so much! |
| 224 | + |
| 225 | +* Abhishek Chanda |
| 226 | +* Adam Perry |
| 227 | +* Ahmed Charles |
| 228 | +* Aidan Hobson Sayers |
| 229 | +* Aleksey Kladov |
| 230 | +* Alexander von Gluck IV |
| 231 | +* Alex Burka |
| 232 | +* Alex Crichton |
| 233 | +* Alex von Gluck IV |
| 234 | +* Amanieu d'Antras |
| 235 | +* Andrea Corradi |
| 236 | +* Andrea Pretto |
| 237 | +* Andreas Sommer |
| 238 | +* Andre Bogus |
| 239 | +* Andrew Paseltiner |
| 240 | +* angelsl |
| 241 | +* Anthony Ramine |
| 242 | +* Ariel Ben-Yehuda |
| 243 | +* arthurprs |
| 244 | +* Austin Hicks |
| 245 | +* bors |
| 246 | +* Brian Anderson |
| 247 | +* Bunts Thy Unholy |
| 248 | +* CensoredUsername |
| 249 | +* Chris McDonald |
| 250 | +* Christopher |
| 251 | +* christopherdumas |
| 252 | +* Christopher Serr |
| 253 | +* Cobrand |
| 254 | +* Corey Farwell |
| 255 | +* Cristi Cobzarenco |
| 256 | +* Daan Sprenkels |
| 257 | +* Danny Hua |
| 258 | +* David Henningsson |
| 259 | +* Devon Hollowood |
| 260 | +* Dmitry Gritsay |
| 261 | +* Dominik Inführ |
| 262 | +* Duncan |
| 263 | +* Eduard Burtescu |
| 264 | +* Eduard-Mihai Burtescu |
| 265 | +* Eric Roshan-Eisner |
| 266 | +* est31 |
| 267 | +* Fabian Frei |
| 268 | +* Federico Mena Quintero |
| 269 | +* Felix S. Klock II |
| 270 | +* Florian Diebold |
| 271 | +* Florian Hartwig |
| 272 | +* Florian Zeitz |
| 273 | +* Frank Rehberger |
| 274 | +* Gavin Baker |
| 275 | +* Geoffry Song |
| 276 | +* Guillaume Gomez |
| 277 | +* iirelu |
| 278 | +* James Miller |
| 279 | +* Jan-Erik Rediger |
| 280 | +* Jared Roesch |
| 281 | +* Jeffrey Seyfried |
| 282 | +* Jesus Garlea |
| 283 | +* Jethro Beekman |
| 284 | +* Joe Neeman |
| 285 | +* Johannes Muenzel |
| 286 | +* John Firebaugh |
| 287 | +* John Hodge |
| 288 | +* johnthagen |
| 289 | +* Jonas Schievink |
| 290 | +* Jonathan Turner |
| 291 | +* Jorge Aparicio |
| 292 | +* Josh Stone |
| 293 | +* Josh Triplett |
| 294 | +* Keegan McAllister |
| 295 | +* Keith Yeung |
| 296 | +* KillTheMule |
| 297 | +* Konrad Borowski |
| 298 | +* leonardo.yvens |
| 299 | +* Liigo Zhuang |
| 300 | +* loggerhead |
| 301 | +* Manish Goregaokar |
| 302 | +* Marcin Fatyga |
| 303 | +* Mark-Simulacrum |
| 304 | +* Martin Glagla |
| 305 | +* Martin Thoresen |
| 306 | +* Mathieu Borderé |
| 307 | +* Mathieu Poumeyrol |
| 308 | +* Matt Brubeck |
| 309 | +* Matthew Piziak |
| 310 | +* Matwey V. Kornilov |
| 311 | +* mcarton |
| 312 | +* Michael Woerister |
| 313 | +* Mikhail Modin |
| 314 | +* Mikko Rantanen |
| 315 | +* msiglreith |
| 316 | +* Nabeel Omer |
| 317 | +* Nathan Musoke |
| 318 | +* Nicholas Nethercote |
| 319 | +* Nick Cameron |
| 320 | +* Nick Fitzgerald |
| 321 | +* Nick Stevens |
| 322 | +* Nikhil Shagrithaya |
| 323 | +* Niko Matsakis |
| 324 | +* Oliver Middleton |
| 325 | +* p512 |
| 326 | +* ParkHanbum |
| 327 | +* Paul Lange |
| 328 | +* Paulo Matos |
| 329 | +* Paul Osborne |
| 330 | +* Peter Atashian |
| 331 | +* Peter N |
| 332 | +* Philip Davis |
| 333 | +* Pieter Frenssen |
| 334 | +* Pweaver (Paul Weaver) |
| 335 | +* pweyck |
| 336 | +* QuietMisdreavus |
| 337 | +* Raph Levien |
| 338 | +* Razican |
| 339 | +* Robin Stocker |
| 340 | +* Ross Schulman |
| 341 | +* Ryan Senior |
| 342 | +* Scott Olson |
| 343 | +* Seo Sanghyeon |
| 344 | +* Simonas Kazlauskas |
| 345 | +* Simon Sapin |
| 346 | +* Srinivas Reddy Thatiparthy |
| 347 | +* Stefan Schindler |
| 348 | +* Stephen M. Coakley |
| 349 | +* Steve Klabnik |
| 350 | +* Steven Fackler |
| 351 | +* Tamir Duberstein |
| 352 | +* Taylor Cramer |
| 353 | +* Tim Neumann |
| 354 | +* Tobias Bucher |
| 355 | +* Tomasz Miąsko |
| 356 | +* tormol |
| 357 | +* Tshepang Lekhonkhobe |
| 358 | +* Ulrik Sverdrup |
| 359 | +* Vadim Chugunov |
| 360 | +* Vadim Petrochenkov |
| 361 | +* Vadzim Dambrouski |
| 362 | +* Vangelis Katsikaros |
| 363 | +* Wang Xuerui |
| 364 | +* Wesley Wiser |
| 365 | +* Zack M. Davis |
| 366 | +* Zoffix Znet |
| 367 | +* Артём Павлов [Artyom Pavlov] |
| 368 | +* 石博文 |
0 commit comments