4 ms·
If I understand the borrowing and lifetime mechanisms of rust it would be trivial to have it say anything that has a lifetime that is active at the end of a sco
by dkhenry 12y ago
If I understand the borrowing and lifetime mechanisms of rust it would be trivial to have it say anything that has a lifetime that is active at the end of a scope is a compiler error.
It would almost be like how in c++ you can disable copying by setting all the copy constructors to delete and then the compiler will tell you if your accidentally making copy's of objects.
- tomp 12y agoI agree, it would probably be trivial. It's mostly a language/library design issue, not a type-systems research problem.
- steveklabnik 12y agoYou're talking about linear types, Rust implements affine types. They're very similar.