-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Branded raw pointer const/mut correctness Was: ContiguousMut
is unsafe to use, because its methods take &self
.
#11
Comments
Yeah that sounds wrong, you shouldn't turn an |
Having worked with I think Having looked at it again specifically for this issue: |
@CAD97 |
I took a closer look, and I think the whole raw pointer stuff in the crate needs a remake. (The branded raw pointers are the side show of the experiment, the branded indices and index ranges the main act.) The reason is that the I think this means that |
ContainerMut
is unsafe to use, because its methods take &self
.ContiguousMut
is unsafe to use, because its methods take &self
.
Indeed, that's "mutating through a shared reference" and very forbidden. (For now, even just producing a mutable reference counts as mutation.) Note that you can use |
(found by @CAD97)
Both
begin_mut
andend_mut
have this issue:indexing/src/container_traits.rs
Lines 25 to 30 in 5549752
Example of usage where
&mut
is obtained from the resulting*mut
:indexing/src/container.rs
Lines 469 to 475 in feeb396
cc @RalfJung
The text was updated successfully, but these errors were encountered: