about summary refs log tree commit diff
path: root/src/rustc/syntax
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2012-03-16 16:25:36 +0100
committerMarijn Haverbeke <marijnh@gmail.com>2012-03-16 17:05:29 +0100
commit35fc4a4291dfc8d33b3b500ff0f1b2748ddd5ff0 (patch)
tree96bcbca364f4cc4d68610271719017b0841c5f97 /src/rustc/syntax
parent25c2be0ff477c5bd6c71f4dc598d7a94c08bb724 (diff)
downloadrust-35fc4a4291dfc8d33b3b500ff0f1b2748ddd5ff0.tar.gz
rust-35fc4a4291dfc8d33b3b500ff0f1b2748ddd5ff0.zip
Check kind bounds when calling methods
Closes #1915
Diffstat (limited to 'src/rustc/syntax')
-rw-r--r--src/rustc/syntax/ext/auto_serialize.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rustc/syntax/ext/auto_serialize.rs b/src/rustc/syntax/ext/auto_serialize.rs
index 9911930184d..3af8992a03f 100644
--- a/src/rustc/syntax/ext/auto_serialize.rs
+++ b/src/rustc/syntax/ext/auto_serialize.rs
@@ -723,8 +723,10 @@ fn mk_deser_fn(cx: ext_ctxt, span: span, name: str, tps: [ast::ty_param],
     let deser_tps: [ast::ty_param] =
         [{ident: "__D",
           id: cx.next_id(),
-          bounds: deser_bnds}] +
-        vec::map(tps) {|tp| cx.clone_ty_param(tp) };
+          bounds: deser_bnds}] + vec::map(tps) {|tp|
+        let cloned = cx.clone_ty_param(tp);
+        {bounds: @(*cloned.bounds + [ast::bound_copy]) with cloned}
+    };
 
     let deser_blk = cx.expr_blk(f(cx, tps_map, #ast(expr){__d}));