Skip to content

Commit 04c735b

Browse files
Apply Mark's suggestions from code review
Co-authored-by: Mark Rousskov <[email protected]>
1 parent 772a85d commit 04c735b

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

posts/2021-10-21-Rust-1.56.0.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: The Rust Release Team
55
release: true
66
---
77

8-
The Rust team is happy to announce a new version of Rust, 1.56.0, and "Rust 2021" as well.
8+
The Rust team is happy to announce a new version of Rust, 1.56.0. This stabilizes the 2021 edition as well.
99
Rust is a programming language empowering everyone to build reliable and efficient software.
1010

1111
If you have a previous version of Rust installed via rustup, getting Rust 1.56.0 is as easy as:
@@ -26,29 +26,30 @@ from the appropriate page on our website, and check out the
2626
### Rust 2021
2727

2828
We wrote about plans for Rust 2021 [in May](https://blog.rust-lang.org/2021/05/11/edition-2021.html).
29-
This is a smaller step for an edition, especially compared to 2018, but there
29+
This a smaller edition, especially compared to 2018, but there
3030
are still some nice quality-of-life changes that require an edition opt-in to
3131
avoid breaking some corner cases in existing code. See the new chapters of the
3232
edition guide below for more details on each new feature and guidance for
3333
migration.
3434

35-
* [Additions to the prelude](https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html): `TryInto`, `TryFrom`, and `FromIterator`.
36-
* [Default Cargo feature resolver](https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html) is now version 2.
37-
* [`IntoIterator` for arrays](https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html) now includes `array.into_iter()` calls.
3835
* [Disjoint capture in closures](https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html) rather than always capturing whole identifiers.
36+
* [`IntoIterator` for arrays](https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html) now includes `array.into_iter()` calls.
37+
* [Or patterns in macro-rules](https://doc.rust-lang.org/edition-guide/rust-2021/or-patterns-macro-rules.html) now match top-level `A|B` in `:pat`.
38+
* [Default Cargo feature resolver](https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html) is now version 2.
39+
* [Additions to the prelude](https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html): `TryInto`, `TryFrom`, and `FromIterator`.
3940
* [Panic macro consistency](https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html) now always uses `format_args!(..)`, just like `println!()`.
4041
* [Reserving syntax](https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html) for `ident#`, `ident"..."`, and `ident'...'`.
4142
* [Warnings promoted to errors](https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html): `bare_trait_objects` and `ellipsis_inclusive_range_patterns`.
42-
* [Or patterns in macro-rules](https://doc.rust-lang.org/edition-guide/rust-2021/or-patterns-macro-rules.html) now match top-level `A|B` in `:pat`.
4343

4444
#### Disjoint capture in closures
4545

4646
Closures automatically capture values or references to identifiers that are
47-
used in the body, but before 2021, they were always captured in whole. The new
48-
disjoint-capture feature will likely simply the way you write closures, so
47+
used in the body, but before 2021, they were always captured as a whole. The new
48+
disjoint-capture feature will likely simplify the way you write closures, so
4949
let's look at a quick example:
5050

5151
```rust
52+
// 2015 or 2018 edition code
5253
let a = SomeStruct::new();
5354

5455
drop(a.x); // Move out of one field of the struct
@@ -67,19 +68,19 @@ above example will compile fine!
6768
This new behavior is only activated in the new edition, since it can change
6869
the order in which fields are dropped. As for all edition changes, an
6970
automatic migration is available, which will update your closures for which
70-
this matters. It can insert `let _ = &a;` inside the closure to force the
71+
this matters by inserting `let _ = &a;` inside the closure to force the
7172
entire struct to be captured as before.
7273

7374
#### Migrating to 2021
7475

7576
The guide includes migration instructions for all new features, and in general
76-
[transitioning an existing project to a new edition](https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html),
77+
[transitioning an existing project to a new edition](https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html).
7778
In many cases `cargo fix` can automate the necessary changes. You may even
7879
find that no changes in your code are needed at all for 2021!
7980

8081
However small this edition appears on the surface, it's still the product
81-
of a lot of hard work from many contributors. Please join us in
82-
[celebration and thanks](https://github.com/rust-lang/rust/issues/88623)!
82+
of a lot of hard work from many contributors: see our dedicated
83+
[celebration and thanks](https://github.com/rust-lang/rust/issues/88623) tracker!
8384

8485
### Cargo `rust-version`
8586

0 commit comments

Comments
 (0)