summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-11-11 17:05:36 +0000
committerbors <bors@rust-lang.org>2018-11-11 17:05:36 +0000
commit5a2ca1a6f18aa93d3120761f614ec2d39b4cb1ac (patch)
tree5df8fbca3ae4018fd3303cf22ba4b0fec0299d68 /src/rustllvm/RustWrapper.cpp
parenta88613c86901083dd9f87c43f41d6c0f84f88dee (diff)
parent1672c27a7dbeda2ea3b1aa775b259fc90a270870 (diff)
downloadrust-5a2ca1a6f18aa93d3120761f614ec2d39b4cb1ac.tar.gz
rust-5a2ca1a6f18aa93d3120761f614ec2d39b4cb1ac.zip
Auto merge of #55657 - davidtwco:issue-55651, r=pnkfelix
NLL Diagnostic Review 3: Unions not reinitialized after assignment into field

Fixes #55651, #55652.

This PR 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 #21232, #54499, #54986).

This PR also fixes #55652 which was marked as requiring investigation
as the changes in this PR add an error that was previously missing
(and mentioned in the review comments) and confirms that the error
that was present is correct and a result of earlier partial
initialization changes in NLL.

r? @pnkfelix (due to earlier work with partial initialization)
cc @nikomatsakis
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions