Linear Types Assume Convergence
5 points by fanf
5 points by fanf
The impression I get is that this "RAII counts as use" approach wouldn't be useful for statically ensuring that implementations of the typestate pattern can only be Droped once the state machine reaches a designated terminal state, which is the main place I would find linear types useful in a codebase that's being responsible about the unavoidably non-zero chance of external termination.
In other words, this feels like it's defining the only problem that matters to me as out of scope in order to cook up a solution analogous to trying to use Rust's checks as a security boundary and treating things like /dev/proc/<PID>/mem as "minor problems" to be blacklisted one-by-one.
Did I miss something?
Yeah, it’s curious. Niko wrote about “must move” types which do what you want, but Yosh seems more interested in the “must consume” requirement and various ergonomic issues. I can’t easily tell if impl !Drop is still part of the plan.