That would be &Cell<T>
, no?
!Sync
and !Send
alone are not sufficient to make this sound; you must also forbid internal references (as Cell
does), because if you don't, it is possible to violate other invariants (such as taking a reference to one enum
variant and then replacing the enum
with another variant, which invalidates the reference).
(Another way around this is to forbid references only when mutating, which is how RefCell
works.)