New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NLL Diagnostic Review 3: Missing errors for borrows of union fields #55696

Merged
merged 2 commits into from Nov 6, 2018

Conversation

Projects
None yet
4 participants
@davidtwco
Member

davidtwco commented Nov 5, 2018

Fixes #55675.

This PR modifies a test to make it more robust (it also fixes indentation on a doc comment, but that's not the point of the PR). See the linked issue for details.

r? @pnkfelix

davidtwco added some commits Nov 4, 2018

Correct indentation on documentation comment.
This commit adjusts the indentation of code within a documentation
comment so that it is correctly highlighted as code by rustdoc.
Update test to force error under NLL.
In each of the three cases in this test, there is a mutable borrow
of some field of the union and then a shared borrow of some other field
immediately following.

Under NLL, the mutable borrow is killed straight away as it isn't
used later - therefore not causing a conflict with the shared borrow.
This commit adds a use of the first mutable borrow to force the intended
errors to appear under NLL.
@pnkfelix

This comment has been minimized.

Member

pnkfelix commented Nov 5, 2018

@bors r+ rollup

@bors

This comment has been minimized.

Contributor

bors commented Nov 5, 2018

📌 Commit ba09ed5 has been approved by pnkfelix

kennytm added a commit to kennytm/rust that referenced this pull request Nov 6, 2018

Rollup merge of rust-lang#55696 - davidtwco:issue-55675, r=pnkfelix
NLL Diagnostic Review 3: Missing errors for borrows of union fields

Fixes rust-lang#55675.

This PR modifies a test to make it more robust (it also fixes indentation on a doc comment, but that's not the point of the PR). See the linked issue for details.

r? @pnkfelix

bors added a commit that referenced this pull request Nov 6, 2018

Auto merge of #55710 - kennytm:rollup, r=kennytm
Rollup of 13 pull requests

Successful merges:

 - #55490 (resolve: Fix ICE in macro import error recovery)
 - #55501 (Make `process_obligations`' computation of `completed` optional.)
 - #55597 (std: Enable usage of `thread_local!` through imports)
 - #55601 (Fix tracking issue numbers for some unstable features)
 - #55621 (Add precision for create_dir function)
 - #55626 (Update emscripten)
 - #55644 (ci: Add Dockerfile for dist-powerpcspe-linux)
 - #55664 (Make "all possible cases" help message uniform with existing help messages)
 - #55689 (miri: binary_op_val -> binary_op_imm)
 - #55694 (Fixes #31076)
 - #55696 (NLL Diagnostic Review 3: Missing errors for borrows of union fields )
 - #55700 (Update ui tests with respect to NLL)
 - #55703 (Update `configure --help` (via configure.py) to reflect decoupling of debug+optimize)

Failed merges:

r? @ghost

kennytm added a commit to kennytm/rust that referenced this pull request Nov 6, 2018

Rollup merge of rust-lang#55696 - davidtwco:issue-55675, r=pnkfelix
NLL Diagnostic Review 3: Missing errors for borrows of union fields

Fixes rust-lang#55675.

This PR modifies a test to make it more robust (it also fixes indentation on a doc comment, but that's not the point of the PR). See the linked issue for details.

r? @pnkfelix

bors added a commit that referenced this pull request Nov 6, 2018

Auto merge of #55710 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests

Successful merges:

 - #55490 (resolve: Fix ICE in macro import error recovery)
 - #55597 (std: Enable usage of `thread_local!` through imports)
 - #55601 (Fix tracking issue numbers for some unstable features)
 - #55621 (Add precision for create_dir function)
 - #55644 (ci: Add Dockerfile for dist-powerpcspe-linux)
 - #55664 (Make "all possible cases" help message uniform with existing help messages)
 - #55689 (miri: binary_op_val -> binary_op_imm)
 - #55694 (Fixes #31076)
 - #55696 (NLL Diagnostic Review 3: Missing errors for borrows of union fields)
 - #55700 (Update ui tests with respect to NLL)
 - #55703 (Update `configure --help` (via configure.py) to reflect decoupling of debug+optimize)

@bors bors merged commit ba09ed5 into rust-lang:master Nov 6, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@davidtwco davidtwco deleted the davidtwco:issue-55675 branch Nov 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment