@@ -365,19 +365,19 @@ fn ser_variant(cx: ext_ctxt,
365
365
let arg_blk =
366
366
cx. blk (
367
367
span,
368
- ser_ty ( cx, tps, tys[ i] , cx. clone ( s) , v) ) ;
368
+ ser_ty ( cx, tps, tys[ i] , cx. clone ( s) , move v) ) ;
369
369
cx. stmt ( argfn ( cx. clone ( s) , i, arg_blk) )
370
370
} ;
371
371
372
372
let body_blk = cx. blk ( span, stmts) ;
373
- let body = cx. blk ( span, ~[ cx. stmt ( bodyfn ( s, body_blk) ) ] ) ;
373
+ let body = cx. blk ( span, ~[ cx. stmt ( bodyfn ( move s, body_blk) ) ] ) ;
374
374
375
375
{ pats: ~[ pat] , guard: None , body: body}
376
376
}
377
377
378
378
fn ser_lambda ( cx : ext_ctxt , tps : ser_tps_map , ty : @ast:: ty ,
379
379
-s : @ast:: expr , -v : @ast:: expr ) -> @ast:: expr {
380
- cx. lambda ( cx. blk ( ty. span , ser_ty ( cx, tps, ty, s , v) ) )
380
+ cx. lambda ( cx. blk ( ty. span , ser_ty ( cx, tps, ty, move s , move v) ) )
381
381
}
382
382
383
383
fn is_vec_or_str ( ty : @ast:: ty ) -> bool {
@@ -415,7 +415,7 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
415
415
416
416
// For unique evecs/estrs, just pass through to underlying vec or str
417
417
ast:: ty_uniq( mt) if is_vec_or_str ( mt. ty ) => {
418
- ser_ty ( cx, tps, mt. ty , s , v)
418
+ ser_ty ( cx, tps, mt. ty , move s , move v)
419
419
}
420
420
421
421
ast:: ty_uniq( mt) => {
@@ -439,7 +439,7 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
439
439
let f = cx. lit_str ( fld. span , cx. parse_sess ( ) . interner . get (
440
440
fld. node . ident ) ) ;
441
441
let i = cx. lit_uint ( fld. span , fidx) ;
442
- let l = ser_lambda ( cx, tps, fld. node . mt . ty , cx. clone ( s) , vf) ;
442
+ let l = ser_lambda ( cx, tps, fld. node . mt . ty , cx. clone ( s) , move vf) ;
443
443
#ast[ stmt] { $( s) . emit_rec_field ( $( f) , $( i) , $( l) ) ; }
444
444
} ;
445
445
let fld_lambda = cx. lambda ( cx. blk ( ty. span , fld_stmts) ) ;
@@ -463,7 +463,7 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
463
463
let arms = ~[
464
464
ser_variant (
465
465
466
- cx, tps, tys, ty. span , s,
466
+ cx, tps, tys, ty. span , move s,
467
467
468
468
// Generate pattern (v1, v2, v3)
469
469
|pats| ast:: pat_tup ( pats) ,
@@ -482,20 +482,19 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
482
482
#ast { $( s) . emit_tup_elt ( $( idx) , $( body) ) }
483
483
} )
484
484
] ;
485
- ~[ cx. alt_stmt ( arms, ty. span , v) ]
485
+ ~[ cx. alt_stmt ( arms, ty. span , move v) ]
486
486
}
487
487
488
488
ast:: ty_path( path, _) => {
489
- if vec:: len ( path. idents ) == 1 u &&
490
- vec:: is_empty ( path. types ) {
489
+ if path. idents . len ( ) == 1 && path. types . is_empty ( ) {
491
490
let ident = path. idents [ 0 ] ;
492
491
493
492
match tps. find ( ident) {
494
493
Some ( f) => f ( v) ,
495
- None => ser_path ( cx, tps, path, s , v)
494
+ None => ser_path ( cx, tps, path, move s , move v)
496
495
}
497
496
} else {
498
- ser_path ( cx, tps, path, s , v)
497
+ ser_path ( cx, tps, path, move s , move v)
499
498
}
500
499
}
501
500
@@ -634,7 +633,7 @@ fn deser_path(cx: ext_ctxt, tps: deser_tps_map, path: @ast::path,
634
633
635
634
fn deser_lambda( cx: ext_ctxt, tps: deser_tps_map, ty: @ast:: ty,
636
635
-d: @ast:: expr) -> @ast:: expr {
637
- cx. lambda( cx. expr_blk( deser_ty( cx, tps, ty, d) ) )
636
+ cx. lambda( cx. expr_blk( deser_ty( cx, tps, ty, move d) ) )
638
637
}
639
638
640
639
fn deser_ty( cx: ext_ctxt, tps: deser_tps_map,
@@ -658,7 +657,7 @@ fn deser_ty(cx: ext_ctxt, tps: deser_tps_map,
658
657
659
658
// For unique evecs/estrs, just pass through to underlying vec or str
660
659
ast:: ty_uniq( mt) if is_vec_or_str( mt. ty) => {
661
- deser_ty( cx, tps, mt. ty, d)
660
+ deser_ty( cx, tps, mt. ty, move d)
662
661
}
663
662
664
663
ast:: ty_uniq( mt) => {
@@ -719,10 +718,10 @@ fn deser_ty(cx: ext_ctxt, tps: deser_tps_map,
719
718
720
719
match tps. find( ident) {
721
720
Some ( f) => f( ) ,
722
- None => deser_path( cx, tps, path, d)
721
+ None => deser_path( cx, tps, path, move d)
723
722
}
724
723
} else {
725
- deser_path( cx, tps, path, d)
724
+ deser_path( cx, tps, path, move d)
726
725
}
727
726
}
728
727
@@ -822,8 +821,9 @@ fn ty_fns(cx: ext_ctxt, name: ast::ident,
822
821
823
822
let span = ty. span;
824
823
~[
825
- mk_ser_fn( cx, span, name, tps, |a, b, c, d| ser_ty( a, b, ty, c, d) ) ,
826
- mk_deser_fn( cx, span, name, tps, |a, b, c| deser_ty( a, b, ty, c) )
824
+ mk_ser_fn( cx, span, name, tps, |a, b, c, d| ser_ty( a, b, ty, move c,
825
+ move d) ) ,
826
+ mk_deser_fn( cx, span, name, tps, |a, b, c| deser_ty( a, b, ty, move c) )
827
827
]
828
828
}
829
829
@@ -881,7 +881,7 @@ fn ser_enum(cx: ext_ctxt, tps: ser_tps_map, e_name: ast::ident,
881
881
fail ~"struct variants unimplemented for auto serialize"
882
882
}
883
883
} ;
884
- let lam = cx. lambda( cx. blk( e_span, ~[ cx. alt_stmt( arms, e_span, v) ] ) ) ;
884
+ let lam = cx. lambda( cx. blk( e_span, ~[ cx. alt_stmt( arms, e_span, move v) ] ) ) ;
885
885
let e_name = cx. lit_str( e_span, @cx. str_of( e_name) ) ;
886
886
~[ #ast[ stmt] { $( s) . emit_enum( $( e_name) , $( lam) ) } ]
887
887
}
@@ -954,8 +954,9 @@ fn enum_fns(cx: ext_ctxt, e_name: ast::ident, e_span: span,
954
954
-> ~[ @ast:: item] {
955
955
~[
956
956
mk_ser_fn( cx, e_span, e_name, tps,
957
- |a, b, c, d| ser_enum( a, b, e_name, e_span, variants, c, d) ) ,
957
+ |a, b, c, d| ser_enum( a, b, e_name, e_span, variants, move c,
958
+ move d) ) ,
958
959
mk_deser_fn( cx, e_span, e_name, tps,
959
- |a, b, c| deser_enum( a, b, e_name, e_span, variants, c) )
960
+ |a, b, c| deser_enum( a, b, e_name, e_span, variants, move c) )
960
961
]
961
962
}
0 commit comments