Closed
Description
Mutating immutable data. All data inside a const item is immutable. Moreover, all data reached through a shared reference or data owned by an immutable binding is immutable, unless that data is contained within an UnsafeCell.
I was wondering how to use *mut pointers in more safe way, I asked this question: https://stackoverflow.com/questions/72541045
A user responded that I read this paragraph wrong, and that modifying data through both UnsafeCell<U>
AND *mut U
would not be UB. Does the above paragraph need to mention raw pointers?
Metadata
Metadata
Assignees
Labels
No labels