Skip to content

Commit c74dea5

Browse files
Tweak wording, resolve TODOs
1 parent 0b19ea9 commit c74dea5

File tree

1 file changed

+35
-22
lines changed

1 file changed

+35
-22
lines changed

posts/2024-09-05-Rust-1.81.0.md

+35-22
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,23 @@ If you'd like to help us out by testing future releases, you might consider upda
2121

2222
### `core::error::Error`
2323

24-
1.81 stabilizes the `Error` trait in `core`, allowing usage of the trait in `#![no_std]` libraries.
25-
26-
TODO: What can we actually say about this? It seems like this mostly enables
27-
things in the ecosystem, but from the langauge/standard library not much has
28-
actually changed in *this* release?
24+
1.81 stabilizes the `Error` trait in `core`, allowing usage of the trait in
25+
`#![no_std]` libraries. This primarily enables the wider Rust ecosystem to
26+
standardize on the same Error trait, regardless of what environments the
27+
library targets.
2928

3029
### New sort implementations
3130

3231
Both the stable and unstable sort implementations in the standard library have
3332
been updated to new algorithms, improving their runtime performance and
34-
compilation time. Both of the new sort algorithms try to detect
35-
incorrect implementations of `Ord` and will panic on such cases if detected.
36-
37-
Users encountering these panics should audit any custom Ord implementations to
38-
ensure they satisfy the requirements documented in [PartialOrd] and [Ord].
33+
compilation time.
3934

40-
TODO: Ideally we'd have text somewhere specific to the new detection that helps
41-
explain how to do this audit or otherwise helps users. This otherwise feels
42-
pretty opaque to me. We might also want to consider whether some kind of
43-
transition rather than panic! is best (not sure how else users would find out
44-
about the problem though). See https://github.com/rust-lang/rust/issues/129561.
35+
Additionally, both of the new sort algorithms try to detect incorrect
36+
implementations of `Ord` that prevent them from being able to produce a
37+
meaningfully sorted result, and will now panic on such cases rather than
38+
returning effectively randomly arranged data. Users encountering these panics
39+
should audit their ordering implementations to ensure they satisfy the
40+
requirements documented in [PartialOrd] and [Ord].
4541

4642
[PartialOrd]: https://doc.rust-lang.org/nightly/std/cmp/trait.PartialOrd.html
4743
[Ord]: https://doc.rust-lang.org/nightly/std/cmp/trait.Ord.html
@@ -61,6 +57,12 @@ you can use `#[expect(clippy::undocumented_unsafe_blocks)]` as you transition,
6157
ensuring that once all unsafe blocks are documented you can opt into denying
6258
the lint to enforce it.
6359

60+
Clippy also has two lints to enforce the usage of this feature and help with
61+
migrating existing attributes:
62+
63+
* [`clippy::allow_attributes`](https://rust-lang.github.io/rust-clippy/master/index.html#/allow_attributes) to restrict allow attributes in favor of `#[expect]` or to migrate `#[allow]` attributes to `#[expect]`
64+
* [`clippy::allow_attributes_without_reason`](https://rust-lang.github.io/rust-clippy/master/index.html#/allow_attributes_without_reason) To require a reason for `#[allow]` attributes
65+
6466
### Lint reasons
6567

6668
Changing the lint level is often done for some particular reason. For example,
@@ -137,20 +139,31 @@ these types allows us to add more useful methods to these types, such as
137139
This completes the transition started in [1.71](https://blog.rust-lang.org/2023/07/13/Rust-1.71.0.html#c-unwind-abi),
138140
which added dedicated `"C-unwind"` (amongst other `-unwind` variants) ABIs for
139141
when unwinding across the ABI boundary is expected. As of 1.81, the non-unwind
140-
ABIs (e.g., `"C"`) will now abort on uncaught unwinds, closing the longstanding soundess problem.
142+
ABIs (e.g., `"C"`) will now abort on uncaught unwinds, closing the longstanding
143+
soundess problem.
141144

142145
Programs relying on unwinding should transition to using `-unwind` suffixed ABI
143146
variants.
144147

145-
TODO: Check on status of https://github.com/rust-lang/rust/issues/123231
146-
147-
#### WASI target naming changed
148+
#### WASI 0.1 target naming changed
148149

149-
Usage of the `wasm32-wasi` target will now issue a compiler warning and request
150-
users switch to the `wasm32-wasip1` target instead. Both targets are the same,
151-
`wasm32-wasi` is only being renamed, and this [change to the WASI target](https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html)
150+
Usage of the `wasm32-wasi` target (which targets WASI 0.1) will now issue a
151+
compiler warning and request users switch to the `wasm32-wasip1` target
152+
instead. Both targets are the same, `wasm32-wasi` is only being renamed, and
153+
this [change to the WASI target](https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html)
152154
is being done to enable removing `wasm32-wasi` in January 2025.
153155

156+
The `wasm32-wasip2` target, which targets WASI 0.2, is now also a tier 2 target.
157+
See [the announcement post](https://blog.rust-lang.org/2024/09/05/wasip2-tier-2.html) for more details.
158+
159+
#### Fixes CVE-2024-43402
160+
161+
`std::process::Command` now correctly escapes arguments when invoking batch
162+
files on Windows in the presence of trailing whitespace or periods (which are
163+
ignored and stripped by Windows).
164+
165+
See more details in the previous [announcement of this change](https://blog.rust-lang.org/2024/09/04/cve-2024-43402.html).
166+
154167
### Other changes
155168

156169
Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.81.0), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-181-2024-09-05), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-181).

0 commit comments

Comments
 (0)