Skip to content

Commit ec91aaa

Browse files
committed
---
yaml --- r: 29994 b: refs/heads/incoming c: 3796228 h: refs/heads/master v: v3
1 parent 2d1c559 commit ec91aaa

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: e5fb58e6c09202df314d3ef6ccb797f2cc8401e2
9+
refs/heads/incoming: 37962288ec80cca6ce027650a3700526feb7ca54
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/rustc/middle/trans/alt.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -794,20 +794,23 @@ fn make_pattern_bindings(bcx: block, phi_bindings: phi_bindings_list)
794794
bcx.fcx.lllocals.insert(binding.pat_id,
795795
local_imm(phi_val));
796796
}
797-
ast::bind_by_value => {
797+
ast::bind_by_value | ast::bind_by_move => {
798798
// by value: make a new temporary and copy the value out
799799
let lltype = type_of::type_of(bcx.fcx.ccx, binding.ty);
800800
let allocation = alloca(bcx, lltype);
801801
let ty = binding.ty;
802-
bcx = copy_val(bcx, INIT, allocation,
803-
load_if_immediate(bcx, phi_val, ty), ty);
802+
bcx = if binding.mode == ast::bind_by_value {
803+
copy_val(bcx, INIT, allocation,
804+
load_if_immediate(bcx, phi_val, ty), ty)
805+
} else {
806+
error!("moving out");
807+
move_val(bcx, INIT, allocation,
808+
{bcx: bcx, val: phi_val, kind: lv_owned}, ty)
809+
};
804810
bcx.fcx.lllocals.insert(binding.pat_id,
805811
local_mem(allocation));
806812
add_clean(bcx, allocation, ty);
807813
}
808-
ast::bind_by_move => {
809-
fail ~"unimplemented -- bblum";
810-
}
811814
}
812815
}
813816

0 commit comments

Comments
 (0)