Closed
Description
In the NLL regions, if a region contains a location L, that means that the region contains the entry point to that location. In the borrow dataflow, however, when we apply statement effects, they take place on the exit from a location. The end result is that kills for borrows are applied slightly too late. Consider something like:
L1: P = &X;
L2: use(P); // last use
L3: X = 1;
The region for P would be inferred to {L1, L2}. Therefore, the kill of L2 needs to include the borrow on line 1. However, what we actually do is to insert the kill after L3.
I noticed this because I was trying to stop emitting EndRegion
statements when using NLL. However, this caused false errors to be omitted. For now, there is a FIXME in the code.