Open rhn opened 7 years ago
That's.. surprising. The generator shouldn't be able to outlive the captures.
Ah. This is fixed in master (intended to be released as 2.x), but we had a bunch of stuff blocking the release, and then real life intervened.. Time to pick that back up I guess.
Using a move closure inside a
struct::fn
which borrows astruct
field results in corrupted memory when that closure is notmove
.Example:
Unfortunately, I don't know if it's a problem with type checking or the unsafe portion. Given some pointers, I will try to debug it myself.