Anyone working on #rustlang crossbeam, I have some (possibly stupid) questions: a) Do we still need to box the `Fn`s, now that we have `PinMut` (at least on nightly), and b) would NLL help with allowin ùsing `Scope` mutably? (for now it uses a RefCell for joins)
-
-
Replying to @llogiq
a) In order to sneak the `FnOnce() -> T + Send + 'a` into `thread::spawn`, we must hide the fact that it borrows `'a`. If we box the function, then we can transmute it into `Box<FnOnce() -> T + Send + 'static>`. I don't see how `PinMut` could replace boxing here. Any ideas?
1 reply 0 retweets 2 likes
b) I don't think so. Note that `Scope::spawn` returns a `ScopedJoinHandle<'scope, T>`, which means it borrows the scope. If `Scope::spawn` took a mutable reference to `Scope`, that would lead to borrowing problems even with NLL.
6:27 AM - 12 Aug 2018
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.