<p dir="auto">I tried to create a generic extern fn, and accidentally left off the type parameter.  That caused an ICE.  This code reproduces it:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn with_type_params&lt;T&gt;() { }

extern fn foo&lt;T&gt;() {
    with_type_params::&lt;T&gt;();
}

fn main() {
    let _a:*u8 = foo;
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">with_type_params</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>

<span class="pl-k">extern</span> <span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-en">with_type_params</span><span class="pl-kos">::</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><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-k">let</span> _a<span class="pl-kos">:</span><span class="pl-c1">*</span><span class="pl-smi">u8</span> = foo<span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">and produces this error from the compiler with <code class="notranslate">RUST_LOG=rustc=1</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="task &lt;unnamed&gt; failed at 'assertion failed: !ty::type_has_params(*s)', /build/buildd/rust-nightly-201308162101~680eb71~raring/src/librustc/middle/trans/monomorphize.rs:78
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task &lt;unnamed&gt; failed at 'explicit failure', /build/buildd/rust-nightly-201308162101~680eb71~raring/src/librustc/rustc.rs:371"><pre lang="text" class="notranslate"><code class="notranslate">task &lt;unnamed&gt; failed at 'assertion failed: !ty::type_has_params(*s)', /build/buildd/rust-nightly-201308162101~680eb71~raring/src/librustc/middle/trans/monomorphize.rs:78
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task &lt;unnamed&gt; failed at 'explicit failure', /build/buildd/rust-nightly-201308162101~680eb71~raring/src/librustc/rustc.rs:371
</code></pre></div>
<p dir="auto">I wouldn't expect the code above to actually compile, since the type parameter is missing, but it should show an error about that rather than an ICE.</p>
<p dir="auto">Trying to fix the problem--changing the bare <code class="notranslate">foo</code> to <code class="notranslate">foo::&lt;int&gt;</code> in <code class="notranslate">main</code>, for instance--produced a normal compiler error: "this item does not take type parameters."  That also seems wrong--if extern fns are not allowed to take type parameters, then shouldn't the compiler should complain about it at the definition?  If they are allowed, then I should be able to take the address of one with the type parameter filled in.  (Indeed, that should be required in order to use them.)</p>
<p dir="auto">This is because they're <code class="notranslate">*u8</code>, so trans sees no substs and it won't monomorphize it. Then it calls <code class="notranslate">type_of</code> on a ty param and ICEs.</p>
<p dir="auto">I think maybe crust functions should have to have explicit type parameter substitutions.</p>