1
Fork 0

Handle autoserializing of str/~.

This commit is contained in:
Michael Sullivan 2012-07-12 00:01:41 -07:00
parent 7b26503566
commit 8ad4e92c2b

View file

@ -459,7 +459,6 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
~[]
}
ast::ty_vstore(@{node: ast::ty_vec(mt),_}, ast::vstore_uniq) |
ast::ty_vec(mt) {
let ser_e =
cx.expr(
@ -477,6 +476,11 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
}]
}
// For unique vstores, just pass through to the underlying vec or str
ast::ty_vstore(ty, ast::vstore_uniq) {
ser_ty(cx, tps, ty, s, v)
}
ast::ty_vstore(_, _) {
cx.span_unimpl(ty.span, "serialization for vstore types");
}
@ -685,12 +689,16 @@ fn deser_ty(cx: ext_ctxt, tps: deser_tps_map,
#ast{ fail }
}
ast::ty_vstore(@{node: ast::ty_vec(mt),_}, ast::vstore_uniq) |
ast::ty_vec(mt) {
let l = deser_lambda(cx, tps, mt.ty, cx.clone(d));
#ast{ std::serialization::read_to_vec($(d), $(l)) }
}
// For unique vstores, just pass through to the underlying vec or str
ast::ty_vstore(ty, ast::vstore_uniq) {
deser_ty(cx, tps, ty, d)
}
ast::ty_vstore(_, _) {
cx.span_unimpl(ty.span, "deserialization for vstore types");
}