3 ms·
That's fair, the ecosystem certainly isn't ready for every use case. What specifically do you mean by "the way the borrow checker handles callbacks"?
by Rusky 9y ago
That's fair, the ecosystem certainly isn't ready for every use case.
What specifically do you mean by "the way the borrow checker handles callbacks"?
- pjmlp 9y agoIt is described in the Non-lexical lifetimes RFC under "Closure desugaring". https://github.com/nikomatsakis/nll-rfc/blob/master/0000-nonlexical-lifetimes.md https://github.com/nikomatsakis/nll-rfc/blob/master/0000-non... Basically if you have a struct to represent, lets say a Window, and inside of it try to reference instance variables on a closure that would handle a button click for example, self will be moved. There are a few workarounds, but all of them are less ergonomic than any mainstream GUI toolkit.