In this, when prepend is called, it clones the head. This calls clone on Option, which will call clone on the Rc<Node<T>> which ups the reference count (which is when I learnt std uses unsafe blocks in it's implementation).
But then I assume the Rcdrop is called at some point as there's only one reference to that list at the prepend right? I'd love to inject a "println!" into Rc::drop or similar to try and work out the flow.
I don't think you can realistically monkey patch methods in Rust. The only options I can think of are:
Do it statically: fork std, modify it, re-compile it locally. Modifying std and trying to use a local build is going to be painful, as std requires nightly and AFAICT there are other, additional complications involved as well.
Do it dynamically, e.g. attach a debugger and load an external dylib. This is probably very complicated, and surely not reliable, since the Rc::drop impls may well have been inlined.