Skip to content

Commit 3612e0c

Browse files
authored
Merge pull request #870 from Mark-Simulacrum/1.54
1.54 release blog post
2 parents 0c0d0da + 69d0416 commit 3612e0c

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed

posts/2021-07-29-Rust-1.54.0.md

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
layout: post
3+
title: "Announcing Rust 1.54.0"
4+
author: The Rust Release Team
5+
release: true
6+
---
7+
8+
The Rust team is happy to announce a new version of Rust, 1.54.0. Rust is a programming language empowering everyone
9+
to build reliable and efficient software.
10+
11+
If you have a previous version of Rust installed via rustup, getting Rust
12+
1.54.0 is as easy as:
13+
14+
```console
15+
rustup update stable
16+
```
17+
18+
If you don't have it already, you can [get `rustup`][install]
19+
from the appropriate page on our website, and check out the
20+
[detailed release notes for 1.54.0][notes] on GitHub.
21+
22+
[install]: https://www.rust-lang.org/install.html
23+
[notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1540-2021-07-29
24+
25+
## What's in 1.54.0 stable
26+
27+
### Attributes can invoke function-like macros
28+
29+
Rust 1.54 supports invoking function-like macros inside attributes. Function-like macros can be either `macro_rules!` based or procedural macros which are invoked like `macro!(...)`. One notable use case for this is including documentation from other files into Rust doc comments. For example, if your project's README represents a good documentation comment, you can use `include_str!` to directly incorporate the contents. Previously, various workarounds allowed similar functionality, but from 1.54 this is much more ergonomic.
30+
31+
32+
```rust=
33+
#![doc = include_str!("README.md")]
34+
```
35+
36+
Macros can be nested inside the attribute as well, for example to include content generated by a build script:
37+
38+
```rust
39+
#[path = concat!(env!("OUT_DIR"), "/generated.rs")]
40+
mod generated;
41+
```
42+
43+
Read [here](https://github.com/rust-lang/rust/pull/83366) for more details.
44+
45+
### wasm32 intrinsics stabilized
46+
47+
A number of intrinsics for the wasm32 platform have been stabilized, which gives access to the SIMD instructions in WebAssembly.
48+
49+
Notably, unlike the previously stabilized `x86` and `x86_64` intrinsics, these do not have a safety requirement to only be called when the appropriate target feature is enabled. This is because WebAssembly was written from the start to validate code safely before executing it, so instructions are guaranteed to be decoded correctly (or not at all).
50+
51+
This means that we can expose some of the intrinsics as entirely safe functions, for example [`v128_bitselect`](https://doc.rust-lang.org/beta/core/arch/wasm32/fn.v128_bitselect.html). However, there are still some intrinsics which are unsafe because they use raw pointers, such as [`v128_load`](https://doc.rust-lang.org/beta/core/arch/wasm32/fn.v128_load.html).
52+
53+
### Incremental Compilation is re-enabled by default
54+
55+
Incremental compilation has been re-enabled by default in this release, after it being disabled by default in 1.52.1.
56+
57+
In Rust 1.52, additional validation was added when loading incremental compilation data from the on-disk cache.
58+
This resulted in a number of pre-existing potential soundness issues being uncovered as the validation changed these silent bugs into internal compiler errors (ICEs).
59+
In response, the Compiler Team decided to disable incremental compilation in the 1.52.1 patch, allowing users to avoid encountering the ICEs and the underlying unsoundness, at the expense of longer compile times. [^1]
60+
61+
Since then, we've conducted a [series of retrospectives][retros] and contributors have been hard at work resolving the reported issues, with some fixes landing in 1.53 and the majority landing in this release. [^2]
62+
63+
There are currently still two known issues which can result in an ICE.
64+
Due to the lack of automated crash reporting, we can't be certain of the full extent of impact of the outstanding issues. However, based on the feedback we received from users affected by the 1.52 release, we believe the remaining issues to be rare in practice.
65+
66+
Therefore, incremental compilation has been re-enabled in this release!
67+
68+
[^1]: The [1.52.1 release notes] contain a more detailed description of these events.
69+
[^2]: The tracking issue for the issues is [#84970].
70+
71+
[#84970]: https://github.com/rust-lang/rust/issues/84970
72+
[1.52.1 release notes]: https://blog.rust-lang.org/2021/05/10/Rust-1.52.1.html
73+
[retros]: https://github.com/rust-lang/compiler-team/issues/435
74+
75+
### Stabilized APIs
76+
77+
The following methods and trait implementations were stabilized.
78+
79+
- [`BTreeMap::into_keys`]
80+
- [`BTreeMap::into_values`]
81+
- [`HashMap::into_keys`]
82+
- [`HashMap::into_values`]
83+
- [`arch::wasm32`]
84+
- [`VecDeque::binary_search`]
85+
- [`VecDeque::binary_search_by`]
86+
- [`VecDeque::binary_search_by_key`]
87+
- [`VecDeque::partition_point`]
88+
89+
[`BTreeMap::into_keys`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.into_keys
90+
[`BTreeMap::into_values`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.into_values
91+
[`HashMap::into_keys`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.into_keys
92+
[`HashMap::into_values`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.into_values
93+
[`arch::wasm32`]: https://doc.rust-lang.org/core/arch/wasm32/index.html
94+
[`VecDeque::binary_search`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.binary_search
95+
[`VecDeque::binary_search_by`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.binary_search_by
96+
[`VecDeque::binary_search_by_key`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.binary_search_by_key
97+
[`VecDeque::partition_point`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.partition_point
98+
99+
### Other changes
100+
101+
There are other changes in the Rust 1.54.0 release:
102+
check out what changed in [Rust](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1540-2021-07-29), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-154-2021-07-29), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-154).
103+
104+
rustfmt has also been fixed in the 1.54.0 release to properly format nested
105+
out-of-line modules. This may cause changes in formatting to files that were
106+
being ignored by the 1.53.0 rustfmt. See details [here](https://github.com/rust-lang/rust/pull/86424).
107+
108+
### Contributors to 1.54.0
109+
110+
Many people came together to create Rust 1.54.0.
111+
We couldn't have done it without all of you.
112+
[Thanks!](https://thanks.rust-lang.org/rust/1.54.0/)

0 commit comments

Comments
 (0)