forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unions reinitialized after assignment into field.
This commit makes two changes: First, it updates the dataflow builder to add an init for the place containing a union if there is an assignment into the field of that union. Second, it stops a "use of uninitialized" error occuring when there is an assignment into the field of an uninitialized union that was previously initialized. Making this assignment would re-initialize the union, as tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`. The check for previous initialization ensures that we do not start supporting partial initialization yet (cc rust-lang#21232, rust-lang#54499, rust-lang#54986).
- Loading branch information
Showing
4 changed files
with
50 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters