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

Mutability makes it worse, but there are at least some issues with borrowing that have nothing to do with mutability. If your experience is with garbage collected languages, I suspect you'll encounter errors that surprise you.


Could you provide an example where the borrowing would cause issues for immutable data?

I'm still learning Rust, but I thought the fact that you could have as many immutable borrows as possible would limit what errors the borrow checker could throw at you.


This is embarrassing, but I'm now second-guessing whether what I wrote was accurate. Sorry.

In penance, here are some links: https://www.reddit.com/r/rust/comments/5ny09j/tips_to_not_fi... https://m-decoster.github.io//2017/01/16/fighting-borrowchk/


Fantastic! Thanks a lot in any case.

I do find the image of "fighting the borrow checker" is quite harmful to how people view Rust. As those links state, an important aspect of teaching Rust is educating people about why the borrow checker complains, so that they might adjust their mental model.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: