summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorMichael Sullivan <sully@msully.net>2012-07-12 00:01:41 -0700
committerMichael Sullivan <sully@msully.net>2012-07-12 00:21:12 -0700
commit8ad4e92c2bf1b40f88c4bad4b8c1243c13d16af6 (patch)
tree2fa871814df74d0a7f90ee799868c184e58b499e /src/libsyntax/ext
parent7b265035661daefd7d30f05896a748e55bb561b0 (diff)
downloadrust-8ad4e92c2bf1b40f88c4bad4b8c1243c13d16af6.tar.gz
rust-8ad4e92c2bf1b40f88c4bad4b8c1243c13d16af6.zip
Handle autoserializing of str/~.
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/auto_serialize.rs12
1 files changed, 10 insertions, 2 deletions
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");
       }