-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NLL and Borrowck dataflow disagree on the meaning of a location #46875
Comments
Sample test case that was failing: src/test/ui/nll/ty-outlives/projection-implied-bound.rs |
After some review of the code and discussion with @pnkfelix, we proposed generalizing the dataflow API slightly to handle this. The idea is to have:
|
In addition to adding edge effects, another possible fix would be to make the "out of scope" effect a "pre-statement" effect, that is evaluated by |
NLL fixes First, introduce pre-statement effects to dataflow to fix #46875. Edge dataflow effects might make that redundant, but I'm not sure of the best way to integrate them with liveness etc., and if this is a hack, this is one of the cleanest hacks I've seen. And I want a small fix to avoid the torrent of bug reports. Second, fix linking of projections to fix #46974 r? @pnkfelix
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:
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.The text was updated successfully, but these errors were encountered: