From 1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 27 Aug 2014 21:46:52 -0400 Subject: Implement generalized object and type parameter bounds (Fixes #16462) --- src/libsyntax/ext/deriving/generic/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libsyntax/ext/deriving') diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index 4b185419b40..50bdc296aad 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -407,9 +407,15 @@ impl<'a> TraitDef<'a> { cx.typarambound(p.to_path(cx, self.span, type_ident, generics)) }).collect(); + // require the current trait bounds.push(cx.typarambound(trait_path.clone())); + // also add in any bounds from the declaration + for declared_bound in ty_param.bounds.iter() { + bounds.push((*declared_bound).clone()); + } + cx.typaram(self.span, ty_param.ident, OwnedSlice::from_vec(bounds), -- cgit 1.4.1-3-g733a5