Chances of no panic contexts and linear types

Hello, what do we have about linear or unleakable types? The main problems I am aware are additional ?Trait bounds, as well as panicking issue. Are there any other major issues?

There is some work going in with effect system, that might potentially allow no panic contexts. If they do, would it be a push for linear types? And if they won't, would it be acceptable solution to allowing it only in panic = "abort" or aborting on unwind?

It would be very useful for async (for parallel structured concurrency) and embedded (to not allocate but borrow).

2 Likes

As far as I'm aware, the traits are the biggest obstacle. It looks like they would have to be either a major backwards-incompatible change, or split the language into two worlds, and/or create new problems for unsafe code.

Lack of panic support could be acceptable. There has already been proposal to ban panics in Drop (and ironically panic in Drop is the current best substitute for linear types).

The canonical posts on the topic are:

and:

https://without.boats/blog/changing-the-rules-of-rust/

and:

https://smallcultfollowing.com/babysteps/blog/2023/03/16/must-move-types/

1 Like