Skip to content

Commit 59d02ed

Browse files
committed
---
yaml --- r: 32348 b: refs/heads/dist-snap c: 5573ad7 h: refs/heads/master v: v3
1 parent 788d1c1 commit 59d02ed

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: e767011b77c654d0a926e752de216661bc5b2c22
10+
refs/heads/dist-snap: 5573ad723fc73197889f5890dc9846ba107757d9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rustc/middle/trans/base.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3112,24 +3112,24 @@ fn trans_arg_expr(cx: block, arg: ty::arg, lldestty: TypeRef, e: @ast::expr,
31123112

31133113
ast::by_copy | ast::by_move => {
31143114
// Ensure that an owned copy of the value is in memory:
3115-
let alloc = alloc_ty(bcx, arg.ty);
3115+
let alloc = alloc_ty(bcx, e_ty);
31163116
let move_out = arg_mode == ast::by_move ||
31173117
ccx.maps.last_use_map.contains_key(e.id);
31183118
if lv.kind == lv_temporary { revoke_clean(bcx, val); }
3119-
if lv.kind == lv_owned || !ty::type_is_immediate(arg.ty) {
3120-
memmove_ty(bcx, alloc, val, arg.ty);
3121-
if move_out && ty::type_needs_drop(ccx.tcx, arg.ty) {
3122-
bcx = zero_mem(bcx, val, arg.ty);
3119+
if lv.kind == lv_owned || !ty::type_is_immediate(e_ty) {
3120+
memmove_ty(bcx, alloc, val, e_ty);
3121+
if move_out && ty::type_needs_drop(ccx.tcx, e_ty) {
3122+
bcx = zero_mem(bcx, val, e_ty);
31233123
}
31243124
} else { Store(bcx, val, alloc); }
31253125
val = alloc;
31263126
if lv.kind != lv_temporary && !move_out {
3127-
bcx = take_ty(bcx, val, arg.ty);
3127+
bcx = take_ty(bcx, val, e_ty);
31283128
}
31293129

31303130
// In the event that failure occurs before the call actually
31313131
// happens, have to cleanup this copy:
3132-
add_clean_temp_mem(bcx, val, arg.ty);
3132+
add_clean_temp_mem(bcx, val, e_ty);
31333133
vec::push(temp_cleanups, val);
31343134
}
31353135
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
trait Foo {
2+
fn foo(self);
3+
}
4+
5+
impl &[int]: Foo {
6+
fn foo(self) {}
7+
}
8+
9+
fn main() {
10+
let items = ~[ 3, 5, 1, 2, 4 ];
11+
items.foo();
12+
}
13+

0 commit comments

Comments
 (0)