Getting the memory semantics right with RC was pretty hairy. This code is not testable yet, but it does compile correctly.