3 ms·
> I'd have imagined these scenarios are all over the place Not as many as you'd imagine, really. The core issue here is that lifetimes are a static validation
by steveklabnik 6y ago
> I'd have imagined these scenarios are all over the place
Not as many as you'd imagine, really.
The core issue here is that lifetimes are a static validation mechanism. But wlroots has pointers that have a dynamic invalidation mechanism. There have been a few big attempts in systems like this to try and validate everything as statically as possible, and just like you'd imagine, the mis-match leads to pain. Rust absolutely has ways of doing dynamic validation, some including unsafe, as you've noticed. But some folks will try to push the boundaries. And that can often be really good! That's how progress is made. But like any experiment, sometimes it doesn't work out well.