|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Announcing Rust 1.25" |
| 4 | +author: The Rust Core Team |
| 5 | +--- |
| 6 | + |
| 7 | +The Rust team is happy to announce a new version of Rust, 1.25.0. 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.25.0 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.25.0][notes] on GitHub. |
| 20 | + |
| 21 | +[install]: https://www.rust-lang.org/install.html |
| 22 | +[notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1250-2018-03-29 |
| 23 | + |
| 24 | +## What's in 1.25.0 stable |
| 25 | + |
| 26 | +Rust 1.25 contains a bunch of stuff! The first one is straightforward: we've |
| 27 | +[upgraded to LLVM 6] from LLVM 4. This has a number of effects, a major one |
| 28 | +being a step closer to AVR support. |
| 29 | + |
| 30 | +A new way to write `use` statements has landed: [nested import groups]. If you've |
| 31 | +ever written a set of imports like this: |
| 32 | + |
| 33 | +```rust |
| 34 | +use std::fs::File; |
| 35 | +use std::io::Read; |
| 36 | +use std::path::{Path, PathBuf}; |
| 37 | +``` |
| 38 | + |
| 39 | +You can now write this: |
| 40 | + |
| 41 | +```rust |
| 42 | +// on one line |
| 43 | +use std::{fs::File, io::Read, path::{Path, PathBuf}}; |
| 44 | + |
| 45 | +// with some more breathing room |
| 46 | +use std::{ |
| 47 | + fs::File, |
| 48 | + io::Read, |
| 49 | + path::{ |
| 50 | + Path, |
| 51 | + PathBuf |
| 52 | + } |
| 53 | +}; |
| 54 | +``` |
| 55 | + |
| 56 | +This can reduce some repetition, and make things a bit more clear. |
| 57 | + |
| 58 | +There are two big documentation changes in this release: first, [Rust By |
| 59 | +Example is now included on doc.rust-lang.org]! We'll be redirecing the old |
| 60 | +domain there shortly. We hope this will bring more attention to a great |
| 61 | +resource, and you'll get a local copy with your local documentation. |
| 62 | + |
| 63 | +Second, back in Rust 1.23, we talked about the change from Hoedown to |
| 64 | +pulldown-cmark. In Rust 1.25, pulldown-cmark is now the default rendering. |
| 65 | +After years, we have finally removed the last bit of C from rustdoc, and |
| 66 | +properly follow the CommonMark spec. |
| 67 | + |
| 68 | +Finally, in [RFC 1358], `#[repr(align(x))]` was accepted. In Rust |
| 69 | +1.25, [it is now stable]! This attribute lets you set the [alignment] |
| 70 | +of your `struct`s: |
| 71 | + |
| 72 | +```rust |
| 73 | +struct NotAligned(i32); |
| 74 | + |
| 75 | +assert_eq!(std::mem::align_of::<NotAligned>(), 4); |
| 76 | +assert_eq!(std::mem::size_of::<NotAligned>(), 4); |
| 77 | + |
| 78 | +#[repr(align(16))] |
| 79 | +struct Align16(i32); |
| 80 | + |
| 81 | +assert_eq!(std::mem::align_of::<Align16>(), 16); |
| 82 | +assert_eq!(std::mem::size_of::<Align16>(), 16); |
| 83 | +``` |
| 84 | + |
| 85 | +If you're working with low-level stuff, control of these kinds of things |
| 86 | +can be very important! |
| 87 | + |
| 88 | +[upgraded to LLVM 6]: https://github.com/rust-lang/rust/pull/47828 |
| 89 | +[nested import groups]: https://github.com/rust-lang/rust/pull/47948 |
| 90 | +[Rust By Example is now included on doc.rust-lang.org]: https://doc.rust-lang.org/rust-by-example/ |
| 91 | +[RFC 1358]: https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md |
| 92 | +[it is now stable]: https://github.com/rust-lang/rust/pull/47006 |
| 93 | +[alignment]: https://en.wikipedia.org/wiki/Data_structure_alignment |
| 94 | + |
| 95 | + |
| 96 | +See the [detailed release notes][notes] for more. |
| 97 | + |
| 98 | +### Library stabilizations |
| 99 | + |
| 100 | + |
| 101 | +Additionally, a few new APIs were stabilized this release: |
| 102 | + |
| 103 | +* [] () |
| 104 | + |
| 105 | +See the [detailed release notes][notes] for more. |
| 106 | + |
| 107 | +### Cargo features |
| 108 | + |
| 109 | + |
| 110 | +See the [detailed release notes][notes] for more. |
| 111 | + |
| 112 | +## Contributors to 1.25.0 |
| 113 | + |
| 114 | +Many people came together to create Rust 1.25. We couldn't have done it |
| 115 | +without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.25.0) |
0 commit comments