@@ -794,20 +794,23 @@ fn make_pattern_bindings(bcx: block, phi_bindings: phi_bindings_list)
794
794
bcx. fcx . lllocals . insert ( binding. pat_id ,
795
795
local_imm ( phi_val) ) ;
796
796
}
797
- ast:: bind_by_value => {
797
+ ast:: bind_by_value | ast :: bind_by_move => {
798
798
// by value: make a new temporary and copy the value out
799
799
let lltype = type_of:: type_of ( bcx. fcx . ccx , binding. ty ) ;
800
800
let allocation = alloca ( bcx, lltype) ;
801
801
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
+ } ;
804
810
bcx. fcx . lllocals . insert ( binding. pat_id ,
805
811
local_mem ( allocation) ) ;
806
812
add_clean ( bcx, allocation, ty) ;
807
813
}
808
- ast:: bind_by_move => {
809
- fail ~"unimplemented -- bblum";
810
- }
811
814
}
812
815
}
813
816
0 commit comments