News for hackers. Stuff that matters.
Re:Moving to a provenance-aware memory object model for C: p... by cesarb on Sunday April 14, 2019 @03:30PM (#19661194)
> you can only take one &mut reference at a time. You can have as many immutable `&` references as you want

There's another small detail: these two cases are mutually exclusive. You can either have one &mut reference, or as many & references as you want. This means that code receiving a & reference can be sure the object won't change, and that code receiving a &mut reference knows the object can be modified safely since nothing else could be looking at it. (Assuming the object doesn't contain a Cell, the rules are a bit different when a Cell is involved.)

There are no comments on this comment yet.