<p dir="auto">The exact engine we use needs further discussion. Probably we don't want to use yarr because it requires the nitro jit, which is a big dependency and could be undesirable for various reasons. Ideally, we would have a nice syntax extension that precompiles the regexes (in addition to runtime compilation options).</p>
<p dir="auto">This program seems correct to me:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fn main(args: [str]) {
    let one = fn@() -&gt; uint {
        enum r { a };
        ret a as uint;
    };
    let two = fn@() -&gt; uint {
        enum r { a };
        ret a as uint;
    };
    one(); two();
}"><pre class="notranslate"><code class="notranslate">fn main(args: [str]) {
    let one = fn@() -&gt; uint {
        enum r { a };
        ret a as uint;
    };
    let two = fn@() -&gt; uint {
        enum r { a };
        ret a as uint;
    };
    one(); two();
}
</code></pre></div>
<p dir="auto">If I compile it with rust <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/0d5d2e5e149f3ca1907e924968e36ca6fe5f45e9/hovercard" href="https://github.com/rust-lang/rust/commit/0d5d2e5e149f3ca1907e924968e36ca6fe5f45e9"><tt>0d5d2e5</tt></a> I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="herugrim::~/code/limerick $ RUST_LOG=rustc=0,::rt::backtrace rustc enumbug.rs
enumbug.rs:2:0: 12:1 warning: unused variable args
enumbug.rs:2 fn main(args: [str]) {
enumbug.rs:3     let one = fn@() -&gt; uint {
enumbug.rs:4         enum r { a };
enumbug.rs:5         ret a as uint;
enumbug.rs:6     };
enumbug.rs:7     let two = fn@() -&gt; uint {
             ...
error: internal compiler error duplicate LLVM symbol: _ZN4main1r1a7discrim17_7bb11dc7a9aa7ee4E
rust: upcall fail 'explicit failure', ../src/rustc/driver/diagnostic.rs:78
rust: upcall fail 'explicit failure', ../src/rustc/driver/rustc.rs:182
rust: domain main @0x7fd822818600 root task failed"><pre class="notranslate"><code class="notranslate">herugrim::~/code/limerick $ RUST_LOG=rustc=0,::rt::backtrace rustc enumbug.rs
enumbug.rs:2:0: 12:1 warning: unused variable args
enumbug.rs:2 fn main(args: [str]) {
enumbug.rs:3     let one = fn@() -&gt; uint {
enumbug.rs:4         enum r { a };
enumbug.rs:5         ret a as uint;
enumbug.rs:6     };
enumbug.rs:7     let two = fn@() -&gt; uint {
             ...
error: internal compiler error duplicate LLVM symbol: _ZN4main1r1a7discrim17_7bb11dc7a9aa7ee4E
rust: upcall fail 'explicit failure', ../src/rustc/driver/diagnostic.rs:78
rust: upcall fail 'explicit failure', ../src/rustc/driver/rustc.rs:182
rust: domain main @0x7fd822818600 root task failed
</code></pre></div>
<p dir="auto">This problem only seems to happen with boxed closures (fn@)</p>