News for hackers. Stuff that matters.
Re:Does the Bronze Garbage Collector Make Rust Easier to Use? by zozbot234 on Thursday December 23, 2021 @01:40PM (#29664941)
> For example, if you have a stack variable and pass a reference to a short-lived thread, Rust will just throw an error, because there is no way for Rust to prove that the lifetime of the borrow is short enough (bounded from above) because Rust does not have linear types.

Rust has scoped threads for this use case. Generally this uses closures as opposed to lifetimes to "bound borrows from above" in a safe way.

Re:Does the Bronze Garbage Collector Make Rust Easier to Use? by klodolph on Thursday December 23, 2021 @01:43PM (#29664990)
Rust has crossbeam, but it is not a complete solution to the problem. Scoped threads were removed.
Re:Does the Bronze Garbage Collector Make Rust Easier to Use? by ssokolow on Thursday December 23, 2021 @02:29PM (#29665520)
Would you mind elaborating?

It was removed from the standard library ages ago, but `crossbeam::scope` appears to still be there in the newest release of crossbeam and the git repo.

Re:Does the Bronze Garbage Collector Make Rust Easier to Use? by klodolph on Thursday December 23, 2021 @10:55PM (#29669987)
Using a scope for spawning threads is a solution to a narrow slice of a much larger problem.