-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix NLL migration mode so that reports region errors when necessary. #53045
Conversation
…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.)
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
This seems like a reasonable approach to me, but I'll delegate to someone more familiar with NLL. |
@bors r+ |
📌 Commit abd81c9 has been approved by |
(Beta nominating because I am pretty sure NLL migration mode was part of beta that was cut most recently.) |
⌛ Testing commit abd81c9 with merge 7b8c1f0794c7df7700d5b1b6727a94d8b30e00e6... |
💔 Test failed - status-travis |
The job Click to expand the log.
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 |
…-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
☀️ Test successful - status-appveyor, status-travis |
Accepting for beta-backport. cc @rust-lang/compiler |
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