summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorSergey Pepyakin <s.pepyakin@gmail.com>2017-10-14 17:18:38 +0300
committerSergey Pepyakin <s.pepyakin@gmail.com>2017-10-24 10:49:01 +0300
commit2e7d9972342c5a614319193cb75e8b1e135167b8 (patch)
tree87da2d9fc54f379392be140125cbd121d3b4af6f /src/codegen/mod.rs
parentdc1e546586b8f90cf280ed8b07799e878486961f (diff)
Derive `Clone` along with `Copy` on latest stable.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 6396e953..607ceafe 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -1642,7 +1642,10 @@ impl CodeGenerator for CompInfo {
ctx.options().derive_copy
{
derives.push("Copy");
- if used_template_params.is_some() {
+
+ if ctx.options().rust_features().builtin_clone_impls() ||
+ used_template_params.is_some()
+ {
// FIXME: This requires extra logic if you have a big array in a
// templated struct. The reason for this is that the magic:
// fn clone(&self) -> Self { *self }