Re:The borrowchecker is what I like the least about Rust
by airstrike on Sunday July 20, 2025 @01:02PM
(#44627066)
Try out iced https://iced.rs next weekend
No need for RefCell anywhere
I'm active on the Discord if you need help getting started
And what's wrong with RefCell (and friends)? It's extra complexity, memory footprint, and runtime cost. Also you gave up on the ability of the compiler to check you program's correctness. Granted it's not much, but neither is std::shared_ptr or Swift's automatic reference counting. Once you go from zero overhead to some overhead, there's a ton of quality of life features you can offer to the programmer.
If Rust's borrow checker was smart enough to allow multiple mutable borrows of the same variable, provided some conditions are met (like if you're borrowing struct S, you could borrow it's fields), it would eliminate the need for much of RefCell hacks, as well as solve the gripes in the article.