Skip to content

Commit 8ad4e92

Browse files
committed
Handle autoserializing of str/~.
1 parent 7b26503 commit 8ad4e92

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/libsyntax/ext/auto_serialize.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
459459
~[]
460460
}
461461

462-
ast::ty_vstore(@{node: ast::ty_vec(mt),_}, ast::vstore_uniq) |
463462
ast::ty_vec(mt) {
464463
let ser_e =
465464
cx.expr(
@@ -477,6 +476,11 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
477476
}]
478477
}
479478

479+
// For unique vstores, just pass through to the underlying vec or str
480+
ast::ty_vstore(ty, ast::vstore_uniq) {
481+
ser_ty(cx, tps, ty, s, v)
482+
}
483+
480484
ast::ty_vstore(_, _) {
481485
cx.span_unimpl(ty.span, "serialization for vstore types");
482486
}
@@ -685,12 +689,16 @@ fn deser_ty(cx: ext_ctxt, tps: deser_tps_map,
685689
#ast{ fail }
686690
}
687691

688-
ast::ty_vstore(@{node: ast::ty_vec(mt),_}, ast::vstore_uniq) |
689692
ast::ty_vec(mt) {
690693
let l = deser_lambda(cx, tps, mt.ty, cx.clone(d));
691694
#ast{ std::serialization::read_to_vec($(d), $(l)) }
692695
}
693696

697+
// For unique vstores, just pass through to the underlying vec or str
698+
ast::ty_vstore(ty, ast::vstore_uniq) {
699+
deser_ty(cx, tps, ty, d)
700+
}
701+
694702
ast::ty_vstore(_, _) {
695703
cx.span_unimpl(ty.span, "deserialization for vstore types");
696704
}

0 commit comments

Comments
 (0)