File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
branches/snap-stage3/src/librustc/middle/trans Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 9b60ecc30ea9f8b951a4114971e190891fa97a91
4
+ refs/heads/snap-stage3: 4f6285fbf9001bd593e5424cc0f7de5609d8db55
5
5
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -1730,8 +1730,15 @@ pub fn copy_args_to_allocas(fcx: fn_ctxt,
1730
1730
// We really should do this regardless of whether self is owned, but
1731
1731
// it doesn't work right with default method impls yet. (FIXME: #2794)
1732
1732
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
+
1735
1742
fcx. llself = Some ( ValSelfData { v : self_val, ..slf} ) ;
1736
1743
add_clean ( bcx, self_val, slf. t ) ;
1737
1744
}
You can’t perform that action at this time.
0 commit comments