Skip to content

Commit fcf6e89

Browse files
committed
---
yaml --- r: 62963 b: refs/heads/snap-stage3 c: 4f6285f h: refs/heads/master i: 62961: 5099473 62959: ecad624 v: v3
1 parent a47de7f commit fcf6e89

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 9b60ecc30ea9f8b951a4114971e190891fa97a91
4+
refs/heads/snap-stage3: 4f6285fbf9001bd593e5424cc0f7de5609d8db55
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/base.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,8 +1730,15 @@ pub fn copy_args_to_allocas(fcx: fn_ctxt,
17301730
// We really should do this regardless of whether self is owned, but
17311731
// it doesn't work right with default method impls yet. (FIXME: #2794)
17321732
if slf.is_owned {
1733-
let self_val = PointerCast(bcx, slf.v,
1734-
T_ptr(type_of(bcx.ccx(), slf.t)));
1733+
let self_val = if datum::appropriate_mode(slf.t).is_by_value() {
1734+
let tmp = BitCast(bcx, slf.v, type_of(bcx.ccx(), slf.t));
1735+
let alloc = alloc_ty(bcx, slf.t);
1736+
Store(bcx, tmp, alloc);
1737+
alloc
1738+
} else {
1739+
PointerCast(bcx, slf.v, T_ptr(type_of(bcx.ccx(), slf.t)))
1740+
};
1741+
17351742
fcx.llself = Some(ValSelfData {v: self_val, ..slf});
17361743
add_clean(bcx, self_val, slf.t);
17371744
}

0 commit comments

Comments
 (0)