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

Fix NLL migration mode so that reports region errors when necessary. #53045

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Aug 3, 2018

The code here was trying to be clever, and say "lets not report diagnostics when we 'know' NLL will report an error about them in the future."

The problem is that in migration mode, when no error was reported here, the NLL error that we "knew" was coming was downgraded to a warning (!).

Thus causing #53026

(I hope it is the only instance of such a scenario, but we will see.)

Anyway, this PR fixes that by only doing the "clever" skipping of region error reporting when we are not in migration mode. As noted in the FIXME, I'm not really thrilled with this band-aid, but it is small enough to be back-ported easily if that is necessary.

Rather than make a separate test for issue 53026, I just took the test that uncovered this in a first place, and extended it (via our revisions system) to explicitly show all three modes in action: AST-borrowck, NLL, and NLL migration mode.

(To be honest I hope not to have to add such revisions to many tests. Instead I hope to adopt some sort of new compare-mode for either borrowck=migrate or for the 2018 edition as a whole.)

Fix #53026

…en necessary.

Namely, the code here was trying to be clever, and say "lets not
report diagnostics when we 'know' NLL will report an error about them
in the future."

The problem is that in migration mode, when no error was reported here,
the NLL error that we "knew" was coming was downgraded to a warning (!).

This fixes that by only doing the "clever" skipping of region error reporting
when we are not in migration mode.

Rather than make a separate test for issue 53026, I just took the test
that uncovered this in a first place, and extended it (via our
revisions system) to explicitly show all three modes in action:
ACT-borrowck, NLL, and NLL migration mode.

(Tto be honest I hope not to have to add such revisions to many tests.
Instead I hope to adopt some sort of new `compare-mode` for either
borrowck=migrate or for the 2018 edition as a whole.)
@rust-highfive
Copy link
Collaborator

r? @cramertj

(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 Aug 3, 2018
@cramertj
Copy link
Member

cramertj commented Aug 3, 2018

This seems like a reasonable approach to me, but I'll delegate to someone more familiar with NLL.

r? @nikomatsakis

@estebank
Copy link
Contributor

estebank commented Aug 4, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Aug 4, 2018

📌 Commit abd81c9 has been approved by estebank

@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 Aug 4, 2018
@pnkfelix pnkfelix added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Aug 4, 2018
@pnkfelix
Copy link
Member Author

pnkfelix commented Aug 4, 2018

(Beta nominating because I am pretty sure NLL migration mode was part of beta that was cut most recently.)

@bors
Copy link
Contributor

bors commented Aug 6, 2018

⌛ Testing commit abd81c9 with merge 7b8c1f0794c7df7700d5b1b6727a94d8b30e00e6...

@bors
Copy link
Contributor

bors commented Aug 6, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 6, 2018
@rust-highfive
Copy link
Collaborator

The job dist-i686-freebsd of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:49:02] [RUSTC-TIMING] proc_macro test:false 10.010
[00:49:02]    Compiling syntax_ext v0.0.0 (file:///checkout/src/libsyntax_ext)
[00:49:26] [RUSTC-TIMING] syntax_ext test:false 24.067

Broadcast message from root@travis-job-ff07c450-0e69-43c8-a19f-2ae264ad2e84
 (unknown) at 4:52 ...
The system is going down for power off NOW!
[00:49:35] 
[00:49:35] Session terminated, terminating shell... ...terminated.

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 143.
travis_time:start:03203ef8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@kennytm
Copy link
Member

kennytm commented Aug 6, 2018

@bors retry travis-ci/travis-ci#4924

@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 Aug 6, 2018
@bors
Copy link
Contributor

bors commented Aug 6, 2018

⌛ Testing commit abd81c9 with merge 78ec12d...

bors added a commit that referenced this pull request Aug 6, 2018
…-ast-borrowck, r=estebank

Fix NLL migration mode so that reports region errors when necessary.

The code here was trying to be clever, and say "lets not report diagnostics when we 'know' NLL will report an error about them in the future."

The problem is that in migration mode, when no error was reported here, the NLL error that we "knew" was coming was downgraded to a warning (!).

Thus causing #53026

(I hope it is the only instance of such a scenario, but we will see.)

Anyway, this PR fixes that by only doing the "clever" skipping of region error reporting when we are not in migration mode. As noted in the FIXME, I'm not really thrilled with this band-aid, but it is small enough to be back-ported easily if that is necessary.

Rather than make a separate test for issue 53026, I just took the test that uncovered this in a first place, and extended it (via our revisions system) to explicitly show all three modes in action: AST-borrowck, NLL, and NLL migration mode.

(To be honest I hope not to have to add such revisions to many tests. Instead I hope to adopt some sort of new `compare-mode` for either borrowck=migrate or for the 2018 edition as a whole.)

Fix #53026
@bors
Copy link
Contributor

bors commented Aug 6, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: estebank
Pushing 78ec12d to master...

@bors bors merged commit abd81c9 into rust-lang:master Aug 6, 2018
@nikomatsakis nikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Aug 9, 2018
@nikomatsakis
Copy link
Contributor

Accepting for beta-backport. cc @rust-lang/compiler

@pietroalbini pietroalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Aug 25, 2018
bors added a commit that referenced this pull request Aug 25, 2018
[beta] Rollup backports

Merged and approved:

* #53030: Updated RELEASES.md for 1.29.0
* #53594: Update RELEASES.md to include clippy-preview
* #53045: Fix NLL migration mode so that reports region errors when necessary.
* #53163: Remove an overly pedantic and wrong assertion

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. 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.

NLL migration mode is accepting code that both NLL and AST-borrowck reject!
8 participants