Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For someone looking for an example of this, here's a SO post: https://stackoverflow.com/questions/74592882/extend-a-string...

Tl;dr Rust can't distinguish between a `Vec` whose length is mutable (which might need to reallocate) and one whose elements are mutable (which can provide mutable references to its elements but will never have to move them), so it prevents mutation in a case where it would be safe.



Isn't the latter just a mutable slice?




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

Search: