<p dir="auto">It has something to do with this hack:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/* Core language traits */

#[cfg(notest)] pub mod kinds;
#[cfg(notest)] pub mod ops;
#[cfg(notest)] pub mod cmp;

// Make core testable by not duplicating lang items. See #2912
#[cfg(test)] extern mod realcore(name = &quot;core&quot;, vers = &quot;0.6&quot;);
#[cfg(test)] pub use kinds = realcore::kinds;
#[cfg(test)] pub use ops = realcore::ops;
#[cfg(test)] pub use cmp = realcore::cmp;"><pre class="notranslate"><code class="notranslate">/* Core language traits */

#[cfg(notest)] pub mod kinds;
#[cfg(notest)] pub mod ops;
#[cfg(notest)] pub mod cmp;

// Make core testable by not duplicating lang items. See #2912
#[cfg(test)] extern mod realcore(name = "core", vers = "0.6");
#[cfg(test)] pub use kinds = realcore::kinds;
#[cfg(test)] pub use ops = realcore::ops;
#[cfg(test)] pub use cmp = realcore::cmp;
</code></pre></div>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn f(x: i32) -&gt; i32 {
    f(x)
}

fn main() {
    println!(&quot;{}&quot;, f(0));
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">:</span> <span class="pl-smi">i32</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">i32</span> <span class="pl-kos">{</span>
    <span class="pl-en">f</span><span class="pl-kos">(</span>x<span class="pl-kos">)</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">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, f<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="0
Program ended."><pre class="notranslate"><code class="notranslate">0
Program ended.
</code></pre></div>
<ul dir="auto">
<li><a href="http://is.gd/46GQ4K" rel="nofollow">http://is.gd/46GQ4K</a></li>
</ul>
<p dir="auto">Note we get a stack overflow as expected(!?) with <code class="notranslate">-O0</code> (observation by mboeh)</p>