Skip to content

Polonius: fix some cases of killed fact generation, and most of the ui test suite#62736

Merged
bors merged 29 commits intorust-lang:masterfrom
lqd:polonius_tests3
Jul 25, 2019
Merged

Polonius: fix some cases of killed fact generation, and most of the ui test suite#62736
bors merged 29 commits intorust-lang:masterfrom
lqd:polonius_tests3

Conversation

@lqd
Copy link
Copy Markdown
Member

@lqd lqd commented Jul 16, 2019

Since basic Polonius functionality was re-enabled by @matthewjasper in #54468, some tests were still failing in the polonius compare-mode.

This PR fixes all but one test in the ui suite by:

  • fixing some bugs in the fact generation code, related to the killed relation: Polonius would incorrectly reject some NLL-accepted code, because of these missing killed facts.
  • ignoring some tests in the polonius compare-mode: a lot of those manually test the NLL or migrate mode, and the failures were mostly artifacts of the test revisions, e.g. that -Z polonius requires full NLLs. Some others were also both failing with NLL and succeeding with Polonius, which we can't encode in tests at the moment.
  • blessing the output of some tests: whenever Polonius and NLL have basically the same errors, except for diagnostics differences, the Polonius output is blessed. Whenever we've advanced into a less experimental phase, we'll want to revisit these cases (much like we did on the NLL test suite last year) to specifically work on diagnostics.

Fact generation changes:

  • we now kill loans on the destination place of Call terminators
  • we now kill loans on the locals destroyed by StorageDead
  • we now also handle assignments to projections: killing the loans on a either a deref-ed local, or the ones whose borrowed_place conflicts with the current place.

One failing test remains: an overflow during fact generation, on a case of polymorphic recursion (and which I'll continue investigating later).

This adds some tests for the fact generation changes, with some simple Polonius cases similar to the existing smoke tests, but also for some cases encountered in the wild (in the rand crate for example).

A more detailed write-up is available here with an explanation for each test failure, the steps taken to resolve it (as a commit in the current PR), NLL and Polonius outputs (and diff), etc.

Since they've worked on this before, and we've discussed some of these failures together:

r? @matthewjasper

Loading
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