From 8ad4e92c2bf1b40f88c4bad4b8c1243c13d16af6 Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Thu, 12 Jul 2012 00:01:41 -0700 Subject: Handle autoserializing of str/~. --- src/libsyntax/ext/auto_serialize.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs index 64da3a7dcbd..0ad0b2dc64d 100644 --- a/src/libsyntax/ext/auto_serialize.rs +++ b/src/libsyntax/ext/auto_serialize.rs @@ -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"); } -- cgit 1.4.1-3-g733a5