@@ -5,7 +5,7 @@ author: The Rust Core Team
5
5
---
6
6
7
7
The Rust team is happy to announce the latest version of Rust, 1.20.0. Rust
8
- is a fast, fearless , and friendly programming language .
8
+ is a systems programming language focused on safety, speed , and concurrency .
9
9
10
10
If you have a previous version of Rust installed, getting Rust 1.20 is as easy as:
11
11
@@ -22,7 +22,7 @@ appropriate page on our website, and check out the [detailed release notes for
22
22
23
23
### What's in 1.20.0 stable
24
24
25
- In Rust, you can define traits, structs, and enums that have "associated functions":
25
+ In Rust, you can already define traits, structs, and enums that have "associated functions":
26
26
27
27
``` rust
28
28
struct Struct ;
@@ -38,7 +38,7 @@ fn main() {
38
38
}
39
39
```
40
40
41
- These are called "associated functions" becuase they are functions that are
41
+ These are called "associated functions" because they are functions that are
42
42
associated with the type, that is, they're attached to the type itself, and
43
43
not any particular instance.
44
44
@@ -143,13 +143,10 @@ front in the future.
143
143
144
144
[ RFC 195 ] : https://github.com/rust-lang/rfcs/blob/master/text/0195-associated-items.md
145
145
146
- Back in [ Rust 1.14] , we announced preliminary support for asm.js and wasm
147
- with the help of Emscripten. Since then, LLVM has added its own support, and
148
- so, we have [ added native wasm support to Rust] ! It's using the
149
- ` wasm32-experimental-emscripten ` target.
146
+ We've also [ fixed a bug] with the ` include! ` macro in documentation tests: for relative
147
+ paths, it erroneously was relative to the working directory, rather than to the current file.
150
148
151
- [ Rust 1.14 ] : https://blog.rust-lang.org/2016/12/22/Rust-1.14.html
152
- [ added native wasm support to Rust ] : https://github.com/rust-lang/rust/pull/42571
149
+ [ fixed a bug ] : https://github.com/rust-lang/rust/pull/43782
153
150
154
151
See the [ detailed release notes] [ notes ] for more.
155
152
@@ -168,12 +165,60 @@ We [upgraded to Unicode 10.0.0](https://github.com/rust-lang/rust/pull/42999).
168
165
Rust] ( https://github.com/rust-lang/rust/pull/42430 ) , no longer relying on
169
166
` cmath ` .
170
167
171
- We now [ skip the main thread's manual stack guard on
172
- Linux] ( https://github.com/rust-lang/rust/pull/43072 ) , due to mitigations in
173
- the kernel against [ Stack
174
- Clash] ( https://access.redhat.com/security/vulnerabilities/stackguard ) .
168
+ We are shipping mitigations against [ Stack
169
+ Clash] ( https://access.redhat.com/security/vulnerabilities/stackguard ) in this
170
+ release, notably, [ stack probes] , and [ skipping the main thread's manual
171
+ stack guard on Linux] . You don't need to do anything to get these protections
172
+ other than using Rust 1.20.
173
+
174
+ [ stack probes ] : https://github.com/rust-lang/rust/pull/42816
175
+ [ skipping the main thread's manual stack guard on Linux ] : (https://github.com/rust-lang/rust/pull/43072)
176
+
177
+ We've added a new trio of sorting functions to the standard library:
178
+ [ ` slice::sort_unstable_by_key ` ] , [ ` slice::sort_unstable_by ` ] , and
179
+ [ ` slice::sort_unstable ` ] . You'll note that these all have "unstable" in the name.
180
+ Stability is a property of sorting algorithms that may or may not matter to you,
181
+ but now you have both options! Here's a brief summary: imagine we had a list
182
+ of words like this:
183
+
184
+ ``` text
185
+ rust
186
+ crate
187
+ package
188
+ cargo
189
+ ```
190
+
191
+ Two of these words, ` cargo ` and ` crate ` , both start with the letter ` c ` . A stable
192
+ sort that sorts only on the first letter must produce this result:
193
+
194
+ ``` text
195
+ crate
196
+ cargo
197
+ rust
198
+ package
199
+ ```
200
+
201
+ That is, becuase ` crate ` came before ` cargo ` in the original list, it must also be
202
+ before it in the final list. An unstable sort could provide this result, but could
203
+ also give this answer too:
204
+
205
+ ``` text
206
+ cargo
207
+ crate
208
+ rust
209
+ package
210
+ ```
211
+
212
+ That is, the results * may* not be in the same original order.
213
+
214
+ As you might imagine, less constraints often means faster results. If you don't care
215
+ about stability, these sorts may be faster for you than the stable variants. As always,
216
+ best to check both and see! These functions were added by [ RFC 1884] , if you'd like
217
+ more details, including benchmarks.
218
+
219
+ [ RFC 1884 ] : https://github.com/rust-lang/rfcs/blob/master/text/1884-unstable-sort.md
175
220
176
- The following APIs were also stabilized:
221
+ Additionally, the following APIs were also stabilized:
177
222
178
223
- [ ` CStr::into_c_string ` ]
179
224
- [ ` CString::as_c_str ` ] and [ ` CString::into_boxed_c_str ` ]
@@ -188,7 +233,6 @@ The following APIs were also stabilized:
188
233
- [ ` f32::from_bits ` ] and [ ` f32::to_bits ` ]
189
234
- [ ` f64::from_bits ` ] and [ ` f64::to_bits ` ]
190
235
- [ ` mem::ManuallyDrop ` ]
191
- - [ ` slice::sort_unstable_by_key ` ] , [ ` slice::sort_unstable_by ` ] , and [ ` slice::sort_unstable ` ]
192
236
- [ ` str::from_boxed_utf8_unchecked ` ]
193
237
- [ ` str::as_bytes_mut ` ]
194
238
- [ ` str::from_utf8_mut ` ] and [ ` str::from_utf8_unchecked_mut ` ]
@@ -237,9 +281,8 @@ See the [detailed release notes][notes] for more.
237
281
Cargo has some nice upgrades this release. First of all, your crates.io
238
282
authentication token used to be stored in ` ~/.cargo/config ` . As a configuration
239
283
file, this would often be stored with ` 644 ` permissions, that is, world-readable.
240
- But it has a secret token in it. We've [ moved the token] ` ~/.cargo/credentials ` ,
284
+ But it has a secret token in it. We've [ moved the token] to ` ~/.cargo/credentials ` ,
241
285
so that it can be permissioned ` 600 ` , and hidden from other users on your system.
242
- You'll get a warning if it's still in your ` ~/.cargo/config ` .
243
286
244
287
[ moved the token ] : https://github.com/rust-lang/cargo/pull/3978
245
288
0 commit comments