mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
rustc: Unbreak old-style boxed traits
This commit is contained in:
parent
b34327be0d
commit
f885205b1b
@ -2348,7 +2348,7 @@ fn trap(bcx: block) {
|
||||
|
||||
fn push_rtcall(ccx: @crate_ctxt, name: ~str, did: ast::def_id) {
|
||||
if ccx.rtcalls.contains_key(name) {
|
||||
fail fmt!("multiple definitions for runtime call %s", name);
|
||||
ccx.sess.bug(fmt!("multiple definitions for runtime call %s", name));
|
||||
}
|
||||
ccx.rtcalls.insert(name, did);
|
||||
}
|
||||
|
@ -550,9 +550,6 @@ fn trans_trait_cast(bcx: block,
|
||||
let v_ty = expr_ty(bcx, val);
|
||||
|
||||
let mut llboxdest = GEPi(bcx, lldest, [0u, 1u]);
|
||||
llboxdest = PointerCast(bcx, llboxdest,
|
||||
T_ptr(type_of::type_of(bcx.ccx(), v_ty)));
|
||||
|
||||
if bcx.tcx().legacy_boxed_traits.contains_key(id) {
|
||||
// Allocate an @ box and store the value into it
|
||||
let {bcx: new_bcx, box: llbox, body: body} = malloc_boxed(bcx, v_ty);
|
||||
@ -562,9 +559,11 @@ fn trans_trait_cast(bcx: block,
|
||||
revoke_clean(bcx, llbox);
|
||||
|
||||
// Store the @ box into the pair
|
||||
Store(bcx, llbox, llboxdest);
|
||||
Store(bcx, llbox, PointerCast(bcx, llboxdest, T_ptr(val_ty(llbox))));
|
||||
} else {
|
||||
// Just store the @ box into the pair.
|
||||
llboxdest = PointerCast(bcx, llboxdest,
|
||||
T_ptr(type_of::type_of(bcx.ccx(), v_ty)));
|
||||
bcx = expr::trans_into(bcx, val, SaveIn(llboxdest));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user