<p dir="auto">I know that the new IO is being worked on, but I could see this being a sneaky thing that gets lost.</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![feature(io)]
use std::io::Write;
fn main() {
    write!(&amp;mut std::io::stdout(), &quot;Hello world&quot;).unwrap();
}"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>feature<span class="pl-kos">(</span>io<span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">use</span> std<span class="pl-kos">::</span>io<span class="pl-kos">::</span><span class="pl-v">Write</span><span class="pl-kos">;</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-en">write</span><span class="pl-en">!</span><span class="pl-kos">(</span>&amp;<span class="pl-k">mut</span> std::io::stdout<span class="pl-kos">(</span><span class="pl-kos">)</span>, <span class="pl-s">"Hello world"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">This code prints nothing. If we use <code class="notranslate">stderr</code> instead, there is output.</p>
<p dir="auto"><code class="notranslate">rustc 1.0.0-nightly (270a677d4 2015-03-07) (built 2015-03-07)</code></p>
<p dir="auto">The <a href="https://github.com/rust-lang/rust/pull/19654" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/19654/hovercard">final step</a> of runtime removal changes the threading/process model so that the process shuts down when the main thread exits. But several shared resources, like the helper thread for timeouts, are shut down when the main thread exits (but before the process ends), and they are not prepared to be used after shut down, but other threads may try to access them during the shutdown sequence of the main thread.</p>
<p dir="auto">As an interim solution, the <code class="notranslate">at_exit</code> cleanup routine is simply skipped.</p>
<p dir="auto">Ultimately, these resources should be made to safely handle asynchronous shutdown, usually by panicking if called from a detached thread when the main thread is ending.</p>