Going through how the facts for Polonius are generated, it looks to me like it's time to do some refactoring. Most of the mess is my fault, I think. This is, as far as I understood, where fact generation currently happens in the module hierarchy.
My hunch is that anything only using MIR or MIR plus
MoveData (which is most of the fact generation) should happen in its own module early in the NLL tree, preferably using precisely one MIR
Visitor, and that only the things actually requiring the provenance variables and other data from type check should happen in that part of the tree. It now seems that there are at least two MIR Visitors, one in invalidation (which is Polonius-specific as far as I can tell?), and one that I use in the liveness submodule (incorrectly placed, as it does other things than liveness, and somewhat oddly positioned in the tree as it doesn't require the liveness inputs anymore).
The entire borrow checker could do with fewer visitors, so :+1: for anything in that direction.