If you use enough Rc<RefCell<T>>, does rust become a garbage collected language?

Thanks for the very thorough response! You made a lot of good points, it's probably easiest to follow if I go through them one by one in the same format.

Yep. Most code doesn't ever create reference cycles though, so I think it's an acceptable sacrifice to require the programmer to break cycles manually when these cases come up, like Swift does.

If I accidentally leaked the guard by making a cycle, then yeah. Otherwise, the single instance of the Rc<RefCell<MutexGuard<_>>> should free normally when it leaves scope, so I'm pretty sure this wouldn't happen. I could be wrong though.

If I unwrapped the Rc<RefCell<_>> each time I needed the value and dropped the handle as soon as I finished with it, I'm pretty sure this wouldn't happen. Horrific runtime cost, but I don't think it would panic.

Yep, tons. It would be the absolute worst. For code that doesn't need to run fast, that shouldn't matter though.

While locking every single variable is absolutely awful, code that doesn't need to run fast would probably still be okay if it did that. There's also the question of how much code there really is that needs to be multithreaded, but doesn't need to run fast.

You got me there. Pattern matching is one of the things that I like the most about rust's syntax, and it would be such a shame to lose it. I think nesting match statements would be able to get around it and make it work, but that's such an ugly thing to need to do.

I actually love the borrow checker and don't fight with it that much at all, I just sometimes wish there was a language that was identical to rust but didn't make me think about where data is owned, so I could prototype faster. I think it's also an interesting question as to whether that hypothetical language has a relatively simple mapping to valid rust code, because it felt like it might, and knowing why or why not would help me understand the language a little better. If it is possible to make it work at all, there's probably a fancy way to optimize out a lot of the unnecessary heap allocations, and that may even result in it generating idiomatic rust code if the input code is written in a way that makes it possible.