Hacker News new | ask | show | jobs
by stable-point 3424 days ago
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.

1 comments

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.