1
Fork 0

Support non-immediates in trans_uniq::copy_val

Issue #409
This commit is contained in:
Brian Anderson 2011-09-24 21:20:36 -07:00
parent 2b15aefffe
commit 4f7ecce7d1
7 changed files with 10 additions and 6 deletions

View file

@ -97,7 +97,7 @@ fn copy_val(cx: @block_ctxt, dst: ValueRef, src: ValueRef,
let {bcx, val: llptr} = alloc_uniq(cx, ty);
Store(bcx, llptr, dst);
let src = Load(bcx, src);
let src = load_if_immediate(bcx, src, content_ty);
let dst = llptr;
let bcx = trans::copy_val(bcx, INIT, dst, src, content_ty);
ret bcx;

View file

@ -1,5 +1,4 @@
// xfail-test
fn f<T>(x: ~T) -> ~T { ret x; }
fn f<@T>(x: ~T) -> ~T { ret x; }
fn main() { let x = f(~3); log *x; }

View file

@ -1,4 +1,3 @@
// xfail-test
fn test(x: bool, foo: ~{x: int, y: int, z: int}) -> int {
let bar = foo;

View file

@ -1,4 +1,3 @@
// xfail-test
use std;
import std::uint;

View file

@ -1,4 +1,3 @@
// xfail-test
use std;
import std::uint;

View file

@ -1,3 +1,5 @@
// xfail-test
type foo = {a: int, b: uint};
tag bar { u(~foo); w(int); }

View file

@ -0,0 +1,6 @@
fn main() {
let x = ~{x: 1};
let bar = x;
assert bar.x == 1;
}