Re:Getting Past “Ampersand-Driven Development” in Rust
by cpuguy83 on Saturday March 11, 2023 @09:23AM
(#35108481)
This is the point of lifetimes.
Everything has a lifetime whether or not it is annotated. Sometimes the compiler doesn't know what the lifetime of an object is, particularly in relation to other objects.
If you can scope something to main() then that is a 'static lifetime and there is no need for a scoped thread for it.
If you can scope something to main() then that is a 'static lifetime and there is no need for a scoped thread for it.