Skip to content

Commit 5498b9a

Browse files
committed
Release notes for Rust 1.49.0
1 parent ba4d6b7 commit 5498b9a

File tree

1 file changed

+169
-0
lines changed

1 file changed

+169
-0
lines changed

posts/2020-12-31-Rust-1.49.0.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
layout: post
3+
title: "Announcing Rust 1.40.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.49.0. Rust is a
9+
programming language that is empowering everyone to build reliable and
10+
efficient software.
11+
12+
If you have a previous version of Rust installed via rustup, getting Rust
13+
1.49.0 is as easy as:
14+
15+
```console
16+
rustup update stable
17+
```
18+
19+
If you don't have it already, you can [get `rustup`][install] from the
20+
appropriate page on our website, and check out the [detailed release notes for
21+
1.49.0][notes] on GitHub.
22+
23+
[install]: https://www.rust-lang.org/install.html
24+
[notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1490-2020-12-31
25+
26+
## What's in 1.49.0 stable
27+
28+
For this release, we have some new targets and an improvement to the test
29+
framework. See the [detailed release notes][notes] to learn about other
30+
changes not covered by this post.
31+
32+
### aarch64 targets
33+
34+
We have two big changes to three targets:
35+
36+
* [`aarch64-unknown-linux-gnu` is now Tier 1](https://github.com/rust-lang/rust/pull/78228)
37+
* [`aarch64-apple-darwin` is now Tier 2](https://github.com/rust-lang/rust/pull/75991)
38+
* [`aarch64-pc-windows-msvc` is now Tier 2](https://github.com/rust-lang/rust/pull/75914)
39+
40+
If you're not familiar with our "tiers" of support, you can read about that
41+
on our [platform support
42+
page](https://doc.rust-lang.org/stable/rustc/platform-support.html). In
43+
brief, Tier 1 is "guaranteed to work," Tier 2 is "guaranteed to build," and
44+
Tier 3 is "code exists but is not tested." If you're a 64-bit ARM user, these
45+
changes mean that Rust programs will work better on your platforms!
46+
47+
### Test framework captures output in threads
48+
49+
Rust's built-in testing framework doesn't have a ton of features, but that
50+
doesn't mean it can't be improved! Consider a test that looks like this:
51+
52+
```rust
53+
#[test]
54+
fn thready_pass() {
55+
println!("fee");
56+
std::thread::spawn(|| {
57+
println!("fie");
58+
println!("foe");
59+
})
60+
.join()
61+
.unwrap();
62+
println!("fum");
63+
}
64+
```
65+
66+
Here's what running this test looks like before Rust 1.49.0:
67+
68+
```text
69+
❯ cargo test
70+
Compiling threadtest v0.1.0 (C:\threadtest)
71+
Finished test [unoptimized + debuginfo] target(s) in 0.38s
72+
Running target\debug\deps\threadtest-02f42ffd9836cae5.exe
73+
74+
running 1 test
75+
fie
76+
foe
77+
test thready_pass ... ok
78+
79+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
80+
81+
Doc-tests threadtest
82+
83+
running 0 tests
84+
85+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
86+
```
87+
88+
You can see that the output from the thread is printed, which intermixes
89+
from the output of the test framework itself. Wouldn't it be nice
90+
if every `println!` worked like that one that prints "`fum`?" Well, [that's
91+
the behavior in Rust 1.49.0](https://github.com/rust-lang/rust/pull/78227):
92+
93+
```text
94+
❯ cargo +nightly test
95+
Compiling threadtest v0.1.0 (C:\threadtest)
96+
Finished test [unoptimized + debuginfo] target(s) in 0.52s
97+
Running target\debug\deps\threadtest-40aabfaa345584be.exe
98+
99+
running 1 test
100+
test thready_pass ... ok
101+
102+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
103+
104+
Doc-tests threadtest
105+
106+
running 0 tests
107+
108+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
109+
```
110+
111+
But don't worry; if the test were to fail, you'll still see all of the
112+
output. By adding a `panic!` to the end of the test, we can see what failure
113+
looks like:
114+
115+
```text
116+
❯ cargo +nightly test
117+
Compiling threadtest v0.1.0 (C:\threadtest)
118+
Finished test [unoptimized + debuginfo] target(s) in 0.52s
119+
Running target\debug\deps\threadtest-40aabfaa345584be.exe
120+
121+
running 1 test
122+
test thready_pass ... FAILED
123+
124+
failures:
125+
126+
---- thready_pass stdout ----
127+
fee
128+
fie
129+
foe
130+
fum
131+
thread 'thready_pass' panicked at 'explicit panic', src\lib.rs:11:5
132+
```
133+
134+
Specifically, the test runner makes sure to capture the output, and saves it
135+
in case the test fails.
136+
137+
### Library changes
138+
139+
In Rust 1.49.0, there are three new stable functions:
140+
141+
- [`slice::select_nth_unstable`]
142+
- [`slice::select_nth_unstable_by`]
143+
- [`slice::select_nth_unstable_by_key`]
144+
145+
And two functions were made `const`:
146+
147+
- [`Poll::is_ready`]
148+
- [`Poll::is_pending`]
149+
150+
See the [detailed release notes][notes] to learn about other changes.
151+
152+
[`slice::select_nth_unstable`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable
153+
[`slice::select_nth_unstable_by`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable_by
154+
[`slice::select_nth_unstable_by_key`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable_by_key
155+
[`Poll::is_ready`]: https://doc.rust-lang.org/stable/std/task/enum.Poll.html#method.is_ready
156+
[`Poll::is_pending`]: https://doc.rust-lang.org/stable/std/task/enum.Poll.html#method.is_pending
157+
158+
### Other changes
159+
160+
[relnotes-cargo]: https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-149-2020-12-31
161+
[relnotes-clippy]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-149
162+
163+
There are other changes in the Rust 1.49.0 release: check out what changed in
164+
[Rust][notes], [Cargo][relnotes-cargo], and [Clippy][relnotes-clippy].
165+
166+
## Contributors to 1.49.0
167+
168+
Many people came together to create Rust 1.49.0. We couldn't have done it
169+
without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.49.0/)

0 commit comments

Comments
 (0)