]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #53045 - pnkfelix:issue-53026-migrate-never-looser-than-ast-borrowck...
authorbors <bors@rust-lang.org>
Mon, 6 Aug 2018 12:00:12 +0000 (12:00 +0000)
committerbors <bors@rust-lang.org>
Mon, 6 Aug 2018 12:00:12 +0000 (12:00 +0000)
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


Trivial merge