rust-lang/rfcs — pull request #78 by matthieu-m (2014-05-16 18:14:46+00:00)
Title: First version of the Extending Safe Mutability proposal.

Here comes an improved version of the discussion started on reddit [An alternative take on memory safety (mutability/aliasing)](http://www.reddit.com/r/rust/comments/25ma77/an_alternative_take_on_memory_safety/).

I went down the rabbit hole, trying to dig up the fundamentals of memory safety at the lowest level available (ie, the C Standard level), hopefully, this work can always be reused later on in the event this RFC does not pan out.

I still feel that segregating mutability from aliasing is a worthy goal in and out of itself. For an extreme example, Concurrent Containers are generally shared and yet you might want to restrict mutation to only some references.

This proposal is thus about achieving safe mutability in the presence of aliasing:
- with the mutability clearly documented in the type system
- and opening the way to compiler-verified safely mutable types (and their methods)

This may be seen as adding significant complexity and it certainly adds complexity to the compiler. From a user point of view, however, the segregation makes both mutability and aliasing explicit and thus more easily searchable; with support from the compiler diagnostics (reporting all useful terms) it might actually end up being both more approachable and more flexible.

Finally, the appeal of immutability may be a sufficient reason in itself: it helps drawing all those users to which immutability has been taught as The Silver Bullet(tm) of programming.