@@ -5,7 +5,7 @@ author: The Rust Core Team
55---
66
77The 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 .
99
1010If you have a previous version of Rust installed, getting Rust 1.20 is as easy as:
1111
@@ -22,7 +22,7 @@ appropriate page on our website, and check out the [detailed release notes for
2222
2323### What's in 1.20.0 stable
2424
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":
2626
2727``` rust
2828struct Struct ;
@@ -38,7 +38,7 @@ fn main() {
3838}
3939```
4040
41- These are called "associated functions" becuase they are functions that are
41+ These are called "associated functions" because they are functions that are
4242associated with the type, that is, they're attached to the type itself, and
4343not any particular instance.
4444
@@ -143,13 +143,10 @@ front in the future.
143143
144144[ RFC 195 ] : https://github.com/rust-lang/rfcs/blob/master/text/0195-associated-items.md
145145
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.
150148
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
153150
154151See the [ detailed release notes] [ notes ] for more.
155152
@@ -168,12 +165,60 @@ We [upgraded to Unicode 10.0.0](https://github.com/rust-lang/rust/pull/42999).
168165Rust] ( https://github.com/rust-lang/rust/pull/42430 ) , no longer relying on
169166` cmath ` .
170167
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
175220
176- The following APIs were also stabilized:
221+ Additionally, the following APIs were also stabilized:
177222
178223- [ ` CStr::into_c_string ` ]
179224- [ ` CString::as_c_str ` ] and [ ` CString::into_boxed_c_str ` ]
@@ -188,7 +233,6 @@ The following APIs were also stabilized:
188233- [ ` f32::from_bits ` ] and [ ` f32::to_bits ` ]
189234- [ ` f64::from_bits ` ] and [ ` f64::to_bits ` ]
190235- [ ` mem::ManuallyDrop ` ]
191- - [ ` slice::sort_unstable_by_key ` ] , [ ` slice::sort_unstable_by ` ] , and [ ` slice::sort_unstable ` ]
192236- [ ` str::from_boxed_utf8_unchecked ` ]
193237- [ ` str::as_bytes_mut ` ]
194238- [ ` str::from_utf8_mut ` ] and [ ` str::from_utf8_unchecked_mut ` ]
@@ -237,9 +281,8 @@ See the [detailed release notes][notes] for more.
237281Cargo has some nice upgrades this release. First of all, your crates.io
238282authentication token used to be stored in ` ~/.cargo/config ` . As a configuration
239283file, 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 ` ,
241285so 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 ` .
243286
244287[ moved the token ] : https://github.com/rust-lang/cargo/pull/3978
245288
0 commit comments