Closed
Description
This program seems correct to me:
fn main(args: [str]) {
let one = fn@() -> uint {
enum r { a };
ret a as uint;
};
let two = fn@() -> uint {
enum r { a };
ret a as uint;
};
one(); two();
}
If I compile it with rust 0d5d2e5 I get:
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@() -> uint {
enumbug.rs:4 enum r { a };
enumbug.rs:5 ret a as uint;
enumbug.rs:6 };
enumbug.rs:7 let two = fn@() -> 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
This problem only seems to happen with boxed closures (fn@)