I'm starting research how affine types are treated in Rust.
Does anyone have a link to the part of the compliler where ownership is handled and, hopefully, some design documents that are relevant?
If you have any commentaries about it, or contacts of a Rust historian who can help me out with some documents of note, it would be greatly appreciated too!
The analysis used to be scope based, but is now more flexible (NLL: non-lexical lifetimes). You can read about NLL's design in the RFC.
The future direction will be Polonius. It will handle everything that NLL does and a little more, but approaches the problem in a different way. You can read about it in