Skip to content
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

Update ui tests with respect to NLL #55700

Merged
merged 15 commits into from
Nov 6, 2018

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Nov 5, 2018

Fix #55533

Most of the time we want to robustify tests, but in this case this
test is deliberately encoding artifacts of AST-borrowck.  So instead
of adding artificial uses that would obscure the aspects of
AST-borrowck that are being tests, we instead use revisions and then
mark the cases that apply to NLL as well as AST-borrowck.
This is not strictly necessary to make this test "more robust with
respect to NLL"; its just an attempt to narrow the scope of the test
and focus on its core.
This is based on the feedback from estebank:

"""
I believe that test can be removed outright. It'd be impossible for a
new change to go through that breaks this kind of output without it
being picked up by multiple other `stderr` tests. This is an artifact
of the transition period to the "new" output style.
"""

see: rust-lang#52663 (comment)
This is a variant of `ui/borrowck/borrowck-closures-mut-of-imm.rs`
that I used to help identify what changes I needed to make to the
latter file in order to recover its instances of E0524 under NLL.

(Basically this test includes the changes you'd need to make to
`ui/borrowck/borrowck-closures-mut-of-imm.rs` in order to get rid of
occurrences of E0596. And then I realized that one needs to add
invocations of the closures in order to properly extend the mutable
reborrows in a manner such that NLL will roughly match AST-borrowck.)
… compare-mode=nll.

NLL has increased precision in its analysis of drop order, and we want
the test annotations to deliberately reflect this by having fewer
ERROR annotations for NLL than for AST-borrowck. The best way to get
this effect is via `// revisions`.

As a drive-by, also added uses of all the borrows just to make it
clear that NLL isn't somehow sidestepping things by using shorter
borrows than you might have otherwise expected. (Of course, the added
uses do not make all that much difference since the relevant types all
declare `impl Drop` and thus those drops have implicit uses anyway.)
@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 5, 2018
@pnkfelix
Copy link
Member Author

pnkfelix commented Nov 5, 2018

r? @davidtwco

@rust-highfive rust-highfive assigned davidtwco and unassigned aturon Nov 5, 2018
@pnkfelix pnkfelix changed the title Update ui tests wrt NLL Update ui tests with respect to NLL Nov 5, 2018
@davidtwco
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 5, 2018

📌 Commit fff9dde has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Nov 6, 2018
…s-wrt-nll, r=davidtwco

Update ui tests with respect to NLL

Fix rust-lang#55533
bors added a commit that referenced this pull request Nov 6, 2018
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 fff9dde into rust-lang:master Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants