From f78a6d32478834cd0898e4132d16ebc809ac5d22 Mon Sep 17 00:00:00 2001 From: steveklabnik Date: Thu, 22 Mar 2018 22:01:02 +0100 Subject: [PATCH 1/4] first part of 1.25 announcement --- _posts/2018-03-29-Rust-1.25.md | 115 +++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 _posts/2018-03-29-Rust-1.25.md diff --git a/_posts/2018-03-29-Rust-1.25.md b/_posts/2018-03-29-Rust-1.25.md new file mode 100644 index 000000000..0dddfd6f0 --- /dev/null +++ b/_posts/2018-03-29-Rust-1.25.md @@ -0,0 +1,115 @@ +--- +layout: post +title: "Announcing Rust 1.25" +author: The Rust Core Team +--- + +The Rust team is happy to announce a new version of Rust, 1.25.0. Rust is a +systems programming language focused on safety, speed, and concurrency. + +If you have a previous version of Rust installed via rustup, getting Rust +1.25.0 is as easy as: + +```bash +$ rustup update stable +``` + +If you don't have it already, you can [get `rustup`][install] from the +appropriate page on our website, and check out the [detailed release notes for +1.25.0][notes] on GitHub. + +[install]: https://www.rust-lang.org/install.html +[notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1250-2018-03-29 + +## What's in 1.25.0 stable + +Rust 1.25 contains a bunch of stuff! The first one is straightforward: we've +[upgraded to LLVM 6] from LLVM 4. This has a number of effects, a major one +being a step closer to AVR support. + +A new way to write `use` statements has landed: [nested import groups]. If you've +ever written a set of imports like this: + +```rust +use std::fs::File; +use std::io::Read; +use std::path::{Path, PathBuf}; +``` + +You can now write this: + +```rust +// on one line +use std::{fs::File, io::Read, path::{Path, PathBuf}}; + +// with some more breathing room +use std::{ + fs::File, + io::Read, + path::{ + Path, + PathBuf + } +}; +``` + +This can reduce some repetition, and make things a bit more clear. + +There are two big documentation changes in this release: first, [Rust By +Example is now included on doc.rust-lang.org]! We'll be redirecing the old +domain there shortly. We hope this will bring more attention to a great +resource, and you'll get a local copy with your local documentation. + +Second, back in Rust 1.23, we talked about the change from Hoedown to +pulldown-cmark. In Rust 1.25, pulldown-cmark is now the default rendering. +After years, we have finally removed the last bit of C from rustdoc, and +properly follow the CommonMark spec. + +Finally, in [RFC 1358], `#[repr(align(x))]` was accepted. In Rust +1.25, [it is now stable]! This attribute lets you set the [alignment] +of your `struct`s: + +```rust +struct NotAligned(i32); + +assert_eq!(std::mem::align_of::(), 4); +assert_eq!(std::mem::size_of::(), 4); + +#[repr(align(16))] +struct Align16(i32); + +assert_eq!(std::mem::align_of::(), 16); +assert_eq!(std::mem::size_of::(), 16); +``` + +If you're working with low-level stuff, control of these kinds of things +can be very important! + +[upgraded to LLVM 6]: https://github.com/rust-lang/rust/pull/47828 +[nested import groups]: https://github.com/rust-lang/rust/pull/47948 +[Rust By Example is now included on doc.rust-lang.org]: https://doc.rust-lang.org/rust-by-example/ +[RFC 1358]: https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md +[it is now stable]: https://github.com/rust-lang/rust/pull/47006 +[alignment]: https://en.wikipedia.org/wiki/Data_structure_alignment + + +See the [detailed release notes][notes] for more. + +### Library stabilizations + + +Additionally, a few new APIs were stabilized this release: + +* [] () + +See the [detailed release notes][notes] for more. + +### Cargo features + + +See the [detailed release notes][notes] for more. + +## Contributors to 1.25.0 + +Many people came together to create Rust 1.25. We couldn't have done it +without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.25.0) From b89915d95e7294ce18d2c681fcafca2d0b72ddf8 Mon Sep 17 00:00:00 2001 From: steveklabnik Date: Fri, 23 Mar 2018 17:19:03 +0100 Subject: [PATCH 2/4] more --- _posts/2018-03-29-Rust-1.25.md | 53 ++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/_posts/2018-03-29-Rust-1.25.md b/_posts/2018-03-29-Rust-1.25.md index 0dddfd6f0..c82565f95 100644 --- a/_posts/2018-03-29-Rust-1.25.md +++ b/_posts/2018-03-29-Rust-1.25.md @@ -23,8 +23,9 @@ appropriate page on our website, and check out the [detailed release notes for ## What's in 1.25.0 stable -Rust 1.25 contains a bunch of stuff! The first one is straightforward: we've -[upgraded to LLVM 6] from LLVM 4. This has a number of effects, a major one +The last few releases have been relatively minor, but Rust 1.25 contains a +bunch of stuff! The first one is straightforward: we've [upgraded to LLVM 6] +from LLVM 4. This has a number of effects, a major one being a step closer to AVR support. A new way to write `use` statements has landed: [nested import groups]. If you've @@ -56,7 +57,7 @@ use std::{ This can reduce some repetition, and make things a bit more clear. There are two big documentation changes in this release: first, [Rust By -Example is now included on doc.rust-lang.org]! We'll be redirecing the old +Example is now included on doc.rust-lang.org]! We'll be redirecting the old domain there shortly. We hope this will bring more attention to a great resource, and you'll get a local copy with your local documentation. @@ -97,15 +98,57 @@ See the [detailed release notes][notes] for more. ### Library stabilizations +The biggest story in libraries this release is [`std::ptr::NonNull`]. This type +is similar to `*mut T`, but is non-null and covariant. This blog post isn't the right +place to explain variance, but in a nutshell, `NonNull`, well, guarantees that it +won't be null, which means that `Option>` is the same size as `Option`. +If you're building a data structure with unsafe code, `NonNull` is often the right +type for you! -Additionally, a few new APIs were stabilized this release: +[`std::ptr::NonNull`]: https://doc.rust-lang.org/std/ptr/struct.NonNull.html -* [] () +`libcore` has [gained a `time` module](https://doc.rust-lang.org/core/time/), +containing the `Duration` type previously only available in `libstd`. + +Additionally, the `new`, `from_secs`, `from_milis`, `from_micros`, and `from_nanos` +functions associated with `Duration` were made `const fn`s, allowing them to be used +to create a `Duration` as a constant expression. See the [detailed release notes][notes] for more. ### Cargo features +Cargo's CLI has one really important change this release: `cargo new` will +[now default](https://github.com/rust-lang/cargo/pull/5029) to generating a +binary, rather than a library. We try to keep Cargo's CLI quite stable, but +this change is important, and is unlikely to cause breakage. + +For some background, `cargo new` accepts two flags: `--lib`, for creating libraries, +and `--bin`, for creating binaries, or executables. If you don't pass one of these +flags, in previous versions of Cargo, it would default to `--lib`. We made this +decision because each binary (often) depends on many libraries, and so the library +case is more common. However, this is incorrect; each library is *depended upon* by +many binaries. Furthermore, when getting stated, what you often want is a program +you can run and play around with. It's not just new Rustaceans though; even very +long-time community members have said that they find this default surprising. +As such, we're changing it. + +Similarly, `cargo new` previously would be a bit opinionated around the names +of packages it would create. Specifically, if your package began with `rust-` +or ended with `-rs`, Cargo would rename it. The intention was that well, +it's a Rust package, this information is redundant. However, people feel +quite strongly about naming, and when they bump into this, they're surprised +and often upset. As such, [we're not going to do that any +more](https://github.com/rust-lang/cargo/pull/5013). + +Many users love `cargo doc`, a way to generate local documentation for their +Cargo projects. [It's getting a huge speed +bump](https://github.com/rust-lang/cargo/pull/5013) in this release, as now, +it uses `cargo check`, rather than a full `cargo build`. + +Additionally, checkouts of git dependencies [should be a lot +faster](https://github.com/rust-lang/cargo/pull/4919), thanks to the use of +hard links where possible. See the [detailed release notes][notes] for more. From 158a14afd25d3c4a849809dfc1bd07220aa017f5 Mon Sep 17 00:00:00 2001 From: Mark Simulacrum Date: Thu, 29 Mar 2018 08:11:18 +0200 Subject: [PATCH 3/4] Fixup nits --- _posts/2018-03-29-Rust-1.25.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/_posts/2018-03-29-Rust-1.25.md b/_posts/2018-03-29-Rust-1.25.md index c82565f95..2db3c5ef6 100644 --- a/_posts/2018-03-29-Rust-1.25.md +++ b/_posts/2018-03-29-Rust-1.25.md @@ -62,19 +62,19 @@ domain there shortly. We hope this will bring more attention to a great resource, and you'll get a local copy with your local documentation. Second, back in Rust 1.23, we talked about the change from Hoedown to -pulldown-cmark. In Rust 1.25, pulldown-cmark is now the default rendering. -After years, we have finally removed the last bit of C from rustdoc, and -properly follow the CommonMark spec. +pulldown-cmark. In Rust 1.25, pulldown-cmark is now the default rendering. We +have finally removed the last bit of C from rustdoc, and now properly follow +the CommonMark spec. Finally, in [RFC 1358], `#[repr(align(x))]` was accepted. In Rust 1.25, [it is now stable]! This attribute lets you set the [alignment] of your `struct`s: ```rust -struct NotAligned(i32); +struct Number(i32); -assert_eq!(std::mem::align_of::(), 4); -assert_eq!(std::mem::size_of::(), 4); +assert_eq!(std::mem::align_of::(), 4); +assert_eq!(std::mem::size_of::(), 4); #[repr(align(16))] struct Align16(i32); @@ -93,7 +93,6 @@ can be very important! [it is now stable]: https://github.com/rust-lang/rust/pull/47006 [alignment]: https://en.wikipedia.org/wiki/Data_structure_alignment - See the [detailed release notes][notes] for more. ### Library stabilizations @@ -110,9 +109,9 @@ type for you! `libcore` has [gained a `time` module](https://doc.rust-lang.org/core/time/), containing the `Duration` type previously only available in `libstd`. -Additionally, the `new`, `from_secs`, `from_milis`, `from_micros`, and `from_nanos` -functions associated with `Duration` were made `const fn`s, allowing them to be used -to create a `Duration` as a constant expression. +Additionally, the `from_secs`, and `from_milis` functions associated with +`Duration` were made `const fn`s, allowing them to be used to create a +`Duration` as a constant expression. See the [detailed release notes][notes] for more. @@ -143,12 +142,13 @@ more](https://github.com/rust-lang/cargo/pull/5013). Many users love `cargo doc`, a way to generate local documentation for their Cargo projects. [It's getting a huge speed -bump](https://github.com/rust-lang/cargo/pull/5013) in this release, as now, -it uses `cargo check`, rather than a full `cargo build`. +bump](https://github.com/rust-lang/cargo/pull/4976) in this release, as now, +it uses `cargo check`, rather than a full `cargo build`, so some scenarios +will get faster. Additionally, checkouts of git dependencies [should be a lot faster](https://github.com/rust-lang/cargo/pull/4919), thanks to the use of -hard links where possible. +hard links when possible. See the [detailed release notes][notes] for more. From 3976db707ab9b8b492ee350e02c2ead17b87eac2 Mon Sep 17 00:00:00 2001 From: Mark Simulacrum Date: Thu, 29 Mar 2018 08:14:38 +0200 Subject: [PATCH 4/4] Reword to not call pulldown-cmark a "rendering" --- _posts/2018-03-29-Rust-1.25.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_posts/2018-03-29-Rust-1.25.md b/_posts/2018-03-29-Rust-1.25.md index 2db3c5ef6..f717bb7c9 100644 --- a/_posts/2018-03-29-Rust-1.25.md +++ b/_posts/2018-03-29-Rust-1.25.md @@ -62,9 +62,9 @@ domain there shortly. We hope this will bring more attention to a great resource, and you'll get a local copy with your local documentation. Second, back in Rust 1.23, we talked about the change from Hoedown to -pulldown-cmark. In Rust 1.25, pulldown-cmark is now the default rendering. We -have finally removed the last bit of C from rustdoc, and now properly follow -the CommonMark spec. +pulldown-cmark. In Rust 1.25, pulldown-cmark is now the default. We have +finally removed the last bit of C from rustdoc, and now properly follow the +CommonMark spec. Finally, in [RFC 1358], `#[repr(align(x))]` was accepted. In Rust 1.25, [it is now stable]! This attribute lets you set the [alignment]