Tweak the type allocated for unique pointers
Seems to be more correctish... Issue #409
This commit is contained in:
parent
777a536313
commit
c5877450e6
@ -4,7 +4,7 @@ import trans_common::*;
|
|||||||
import trans_build::*;
|
import trans_build::*;
|
||||||
import trans::{
|
import trans::{
|
||||||
trans_shared_malloc,
|
trans_shared_malloc,
|
||||||
type_of_or_i8,
|
type_of_inner,
|
||||||
size_of,
|
size_of,
|
||||||
move_val_if_temp,
|
move_val_if_temp,
|
||||||
node_id_type,
|
node_id_type,
|
||||||
@ -54,7 +54,9 @@ fn alloc_uniq(cx: @block_ctxt, uniq_ty: ty::t)
|
|||||||
bcx = r.bcx;
|
bcx = r.bcx;
|
||||||
let llsz = r.val;
|
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);
|
r = trans_shared_malloc(bcx, llptrty, llsz);
|
||||||
bcx = r.bcx;
|
bcx = r.bcx;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// xfail-test
|
|
||||||
|
|
||||||
obj ob<K>(k: K) {
|
obj ob<K>(k: K) {
|
||||||
iter foo() -> ~{a: K} { put ~{a: k}; }
|
iter foo() -> ~{a: K} { put ~{a: k}; }
|
||||||
|
@ -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() {
|
fn main() {
|
||||||
let x: ~{x: int, y: int, z: int} = box::<int>({x: 1, y: 2, z: 3});
|
let x: ~{x: int, y: int, z: int} = box::<int>({x: 1, y: 2, z: 3});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user