rust-lang/rust — pull request #15341 by blake2-ppc (2014-07-02 17:29:58+00:00)
Title: Avoid allocation for every use of task local standard out

Change private items std::io::stdio::{local_stdout, with_task_stdout} to
use RefCell.

Use RefCell to avoid having to replace out and replace back the TLS key
for the task local standard out object. It was noticed replace uses
a small allocation every time a key is set.

This way, with_task_stdout cannot be used nested anymore -- even though
I don't think it ever was, nor should it possible with the public API.