diff options
Diffstat (limited to 'src/libsyntax/ext/deriving')
| -rw-r--r-- | src/libsyntax/ext/deriving/generic/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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), |
