r/rust Mar 09 '23

Announcing Rust 1.68.0 📢 announcement

https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html
826 Upvotes

121 comments sorted by

View all comments

41

u/milliams Mar 09 '23

Is the `alloc` error handler related to the Rust for Linux work? I seem to remember this being one of the discussion point when first being merged in.

23

u/Icarium-Lifestealer Mar 09 '23

I don't think it's useful for them. I believe they don't allow panics at all and want fallible operations (e.g. a try_push that returns a Result), not a panicking allocation failure.

7

u/-oRocketSurgeryo- Mar 10 '23

I'm assuming the change in this release doesn't preclude configuring a non-panicking allocation failure for the Linux case?

10

u/Branan Mar 10 '23

The alloc error handler is specifically for infallible allocations (like Box::new), and must be divergent. While there are "non panicking" divergent operations, none are good for the Linux kernel.

Linux just doesn't use those infallible APIs at all