generator + nll : creating movable self referencing object #47516
Labels
A-coroutines
Area: Coroutines
A-NLL
Area: Non-lexical lifetimes (NLL)
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Using generator and nll, one can create an object that point to itself, and then move it.
example outputing garbadge: https://play.rust-lang.org/?gist=ae6ddabbc8ddc411dcedd3fc48a8ee28&version=nightly
Reddit discution: https://www.reddit.com/r/rust/comments/7qwe76/self_borrowing_struct_and_generators/
As pointed by a redditor, #47353 point that @nikomatsakis know there is borrowing issues. Here is an example of such a problematic case.
The text was updated successfully, but these errors were encountered: