Rust 1.81.0 released
Posted Sep 5, 2024 18:52 UTC (Thu)
by python (guest, #171317)
[Link] (4 responses)
Posted Sep 5, 2024 19:35 UTC (Thu)
by proski (subscriber, #104)
[Link] (1 responses)
Posted Sep 5, 2024 21:28 UTC (Thu)
by Vorpal (guest, #136011)
[Link]
A big one for unsafe code. (Also several other things.)
Posted Sep 7, 2024 7:58 UTC (Sat)
by beagnach (guest, #32987)
[Link] (1 responses)
Posted Sep 7, 2024 10:54 UTC (Sat)
by excors (subscriber, #95769)
[Link]
> Originally, the `Error` trait was defined in libcore, and the impls were scattered about. However, coherence objected to this arrangement, because to create the blanket impls for `Box` required knowing that `&str: !Error`, and we have no means to deal with that sort of conflict just now. Therefore, for the time being, we have moved the `Error` trait into libstd. As we evolve a sol'n to the coherence challenge (e.g., specialization, neg impls, etc) we can reconsider what crate these items belong in.
i.e. some fiddly technical reason.
As far as I can see, another issue was the (experimental, nightly-only) error.backtrace() API that gave an OS-specific Backtrace object. OS-specific types have to go in std (because core is designed to be used when you don't even have an OS), and core cannot depend on std, so Error had to go in std.
Rust 1.64 replaced the backtrace() method with a generic provide<T>() method that can return backtraces (or other things), and moved some Box<dyn Error> stuff from the Error code to the Box code, which let them move Error from std to core (in 1.65, with an unstable feature flag). And now they're confident enough in the design to declare it as stable and let people start relying on it.
It's about time!
I agree. 1.81 is one on the most important releases, comparable to 1.75 that allowed async in traits.
Error handling is one of the main selling points of Rust, and not having the Error trait in no_std was a major limitation.
It's about time!
It's about time!
It's about time!
It's about time!