<p dir="auto">Test case:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#[no_mangle]
fn main() {}"><pre class="notranslate"><span class="pl-c1">#<span class="pl-kos">[</span>no_mangle<span class="pl-kos">]</span></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-kos">}</span></pre></div>
<p dir="auto">Output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="nom.rs:2:1: 2:13 warning: function main is marked #[no_mangle], but not exported, #[warn(private_no_mangle_fns)] on by default
nom.rs:2 fn main() {}
         ^~~~~~~~~~~~
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/include/llvm/Support/Casting.h:237: typename llvm::cast_retty&lt;X, Y*&gt;::ret_type llvm::cast(Y*) [with X = llvm::Function; Y = llvm::Value; typename llvm::cast_retty&lt;X, Y*&gt;::ret_type = llvm::Function*]: Assertion `isa&lt;X&gt;(Val) &amp;&amp; &quot;cast&lt;Ty&gt;() argument of incompatible type!&quot;' failed.
Aborted"><pre class="notranslate"><code class="notranslate">nom.rs:2:1: 2:13 warning: function main is marked #[no_mangle], but not exported, #[warn(private_no_mangle_fns)] on by default
nom.rs:2 fn main() {}
         ^~~~~~~~~~~~
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/include/llvm/Support/Casting.h:237: typename llvm::cast_retty&lt;X, Y*&gt;::ret_type llvm::cast(Y*) [with X = llvm::Function; Y = llvm::Value; typename llvm::cast_retty&lt;X, Y*&gt;::ret_type = llvm::Function*]: Assertion `isa&lt;X&gt;(Val) &amp;&amp; "cast&lt;Ty&gt;() argument of incompatible type!"' failed.
Aborted
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#[no_mangle]
fn main() {
    println!(&quot;hello world&quot;);
}"><pre class="notranslate"><code class="notranslate">#[no_mangle]
fn main() {
    println!("hello world");
}
</code></pre></div>
<p dir="auto">when <code class="notranslate">rustc hello.rs</code>, rustc panicked:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc: /home/liigo/rust/rust/src/llvm/include/llvm/Support/Casting.h:237: typename llvm::cast_retty&lt;X, Y*&gt;::ret_type llvm::cast(Y*) [with X = llvm::Function; Y = llvm::Value; typename llvm::cast_retty&lt;X, Y*&gt;::ret_type = llvm::Function*]: Assertion `isa&lt;X&gt;(Val) &amp;&amp; &quot;cast&lt;Ty&gt;() argument of incompatible type!&quot;' failed.
[1]    4419 abort      rustc hello.rs"><pre class="notranslate"><code class="notranslate">rustc: /home/liigo/rust/rust/src/llvm/include/llvm/Support/Casting.h:237: typename llvm::cast_retty&lt;X, Y*&gt;::ret_type llvm::cast(Y*) [with X = llvm::Function; Y = llvm::Value; typename llvm::cast_retty&lt;X, Y*&gt;::ret_type = llvm::Function*]: Assertion `isa&lt;X&gt;(Val) &amp;&amp; "cast&lt;Ty&gt;() argument of incompatible type!"' failed.
[1]    4419 abort      rustc hello.rs
</code></pre></div>