From 35fc4a4291dfc8d33b3b500ff0f1b2748ddd5ff0 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 16 Mar 2012 16:25:36 +0100 Subject: Check kind bounds when calling methods Closes #1915 --- src/rustc/syntax/ext/auto_serialize.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/rustc/syntax') 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})); -- cgit 1.4.1-3-g733a5