Hacker News new | past | comments | ask | show | jobs | submit login

split_at_mut doesn't allow you to read through aliased "active" &mut pointers either (I would assume that restrict pointers that cannot be either read from or written to don't count).



Right, but they both exist. I guess that’s what I’m trying to say... it’s the active bit that matters.


Hm, in that case you don't need to appeal to split_at_mut--reborrowing is sufficient to demonstrate that point. I think what czwarich is saying is more subtle--that restrict allows "multiple readers, exclusive writer", which means that both shared pointers without UnsafeCell and mutable references in Rust are restrict in this sense, while &mut is more restrictive.


That’s fair, but I feel like split_at_mut is far more well-known than reborrowing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: