Skip to content

Commit d4351c9

Browse files
committed
rustc: Fix ICE when de-exporting rt
1 parent c74f87b commit d4351c9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/rustc/middle/trans/base.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,10 +2347,15 @@ fn trap(bcx: block) {
23472347
}
23482348

23492349
fn push_rtcall(ccx: @crate_ctxt, name: ~str, did: ast::def_id) {
2350-
if ccx.rtcalls.contains_key(name) {
2351-
ccx.sess.bug(fmt!("multiple definitions for runtime call %s", name));
2350+
match ccx.rtcalls.find(name) {
2351+
Some(existing_did) if did != existing_did => {
2352+
ccx.sess.fatal(fmt!("multiple definitions for runtime call %s",
2353+
name));
2354+
}
2355+
Some(_) | None => {
2356+
ccx.rtcalls.insert(name, did);
2357+
}
23522358
}
2353-
ccx.rtcalls.insert(name, did);
23542359
}
23552360

23562361
fn gather_local_rtcalls(ccx: @crate_ctxt, crate: @ast::crate) {

0 commit comments

Comments
 (0)