@pnkfelix and I had a chat today about strategy. We decided to try for a two-pronged assault:
- On rust-lang master, we will land a weakened version of NLL that we hypothesize will be much more efficient (but much less expressive). This will be based on the SEME regions described by @zwarich in RFC 396.
- I’ve implemented the RFC in this github repo and I plan to try and integrate it with the existing NLL implementation.
- In the meantime, we will continue to improve the more expressive
borrow-check definition implementation until it is performant.
The idea is that if we can get a working, but suboptimal, NLL sooner, that will let us put more effort into the “polish” (e.g., error messages). We can also proceed to enabling warnings and things derived from MIR borrowck, which closes a large number of bugs with the existing AST-based borrowck.
(I do not believe that SEME regions alone will be a terribly satisfying final result – they don’t cover a lot of the examples we had in mind for NLL. But they will definitely be a big improvement on the status quo in the meantime, and they are expressive enough to overcome a number of false positives that arise from fixing the bugs in the AST borrowck.)
(In parallel, I expect us to continue working on the borrow-check repo. Once we are able to get the analysis sufficiently fast, we can work on converting the MIR borrowck to use those results. Personally I hope to drive that development more through mentoring than direct coding, in part because I would like to have a group of people that know the codebase well, rather than being the only one.)