Tweak the type allocated for unique pointers

Seems to be more correctish...

Issue #409
This commit is contained in:
Brian Anderson 2011-09-24 01:52:45 -07:00
parent 777a536313
commit c5877450e6
3 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@ import trans_common::*;
import trans_build::*;
import trans::{
trans_shared_malloc,
type_of_or_i8,
type_of_inner,
size_of,
move_val_if_temp,
node_id_type,
@ -54,7 +54,9 @@ fn alloc_uniq(cx: @block_ctxt, uniq_ty: ty::t)
bcx = r.bcx;
let llsz = r.val;
let llptrty = T_ptr(type_of_or_i8(bcx, contents_ty));
let ccx = bcx_ccx(bcx);
check non_ty_var(ccx, contents_ty);
let llptrty = T_ptr(type_of_inner(ccx, bcx.sp, contents_ty));
r = trans_shared_malloc(bcx, llptrty, llsz);
bcx = r.bcx;

View File

@ -1,4 +1,3 @@
// xfail-test
obj ob<K>(k: K) {
iter foo() -> ~{a: K} { put ~{a: k}; }

View File

@ -1,6 +1,5 @@
// xfail-test
fn box<T>(x: {x: T, y: T, z: T}) -> ~{x: T, y: T, z: T} { ret ~x; }
fn box<@T>(x: {x: T, y: T, z: T}) -> ~{x: T, y: T, z: T} { ret ~x; }
fn main() {
let x: ~{x: int, y: int, z: int} = box::<int>({x: 1, y: 2, z: 3});