logoalt Hacker News

steveklabnikyesterday at 10:57 PM1 replyview on HN

Rust has affine types, not linear. It also doesn't have mutable value semantics, it uses references, lifetimes, and borrowing.


Replies

EnPissantyesterday at 11:08 PM

I've never seen any significant difference in linear vs affine types.

To me it just seems like Rust has Linear types, and the compiler just inserts some code to destroy your values for you if you don't do it yourself.

I guess the only difference is that linear types can _force_ you to manually consume a value (not necessarily via drop)? Is that what you are going for?

show 1 reply