When nested subfield of a union is moved, move checker incorrectly permits access to its "uncle" fields #41126
Labels
A-borrow-checker
Area: The borrow checker
I-needs-decision
Issue: In need of a decision.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
When implementing move checking for unions I incorrectly assumed that moves automatically "propagate" to parent "loan paths", like in borrow checker, e.g.
, this turns out to not be the case.
This case was missed in tests, so the error went unnoticed.
I have some quick fix, will submit tomorrow.
The text was updated successfully, but these errors were encountered: