3 ms·
Battles with the borrow checker are seldom won. Victory is conceding that the compiler knows better than you and fixing your design. (I’m serious about this, a
by chrismorgan 6y ago
Battles with the borrow checker are seldom won. Victory is conceding that the compiler knows better than you and fixing your design.
(I’m serious about this, as a user for eight years and casual trainer for several. The fact of the matter is that when the borrow checker complains, it’s right to complain, >99.99% of the time, even if you had thought carefully about it and were sure you got it right and that the compiler’s complaint was unnecessary.)
- thethirdone 6y agoI would lower the percentage it is right to complain about to only 99.9% (without non-lexical lifetimes it is probably only right 99% of the time). I have encountered like 3 cases where the borrow checker complained and forced me to make a worse design. I think I have seen more than 1000 and less than 10,000 borrow checking errors.