mozilla/rust — pull request #14928 by gereeter (2014-06-16 03:20:56+00:00)
Title: Add a RefCell-free way to make cycles in Rc and Arc

We currently tell people to use `Weak` to break cycles, but only provide two ways to do so, both unsavory: `unsafe` and `RefCell`. Additionally, there is nothing built into either of those mechanisms that prevents creating an `Rc` cycle. This PR fixes that.

Incidentally, I haven't seen any convincing uses for reference counted cycles, so I have no idea if this is the ideal API. However, it is definitely better than what is currently in place.