Researching how affine types are implemented in Rust

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!

You may want to search for "move semantics" or "ownership" or "borrow checker".

See this section of the rustc dev guide.

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

2 Likes

That is exactly what I was searching for, tyvm!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.