Stream: t-compiler/wg-polonius

Topic: refactoring fact generation


Albin Stjerna (Aug 22 2019 at 12:54, on Zulip):

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).

Matthew Jasper (Aug 26 2019 at 11:47, on Zulip):

The entire borrow checker could do with fewer visitors, so :+1: for anything in that direction.

Last update: Nov 15 2019 at 20:00UTC