Idea : Explicit And More Flexible Lifetime Annotation And Thread's At Exit Hook

How is anyone to know that MyLifetime3 is to be moved into the at_exit closure and not kept in the calling scope (yet is still associated with it)? Why is it not moved into the spawn closure? You really need more structuring here. How is any kind of checker to know that spawn and at_exit have this "at_exit can end lifetimes for things in spawn because…it is required to be called after spawn is done with its caller" property?

I'll quote myself here:

5 Likes