about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-04-26 14:54:37 -0700
committerbors <bors@rust-lang.org>2016-04-26 14:54:37 -0700
commit8f552181895921a377ab8c235340ea3d80ec7fc0 (patch)
tree92395c4d4b72986babdc2b9e53646229c39cccc1 /src/rustllvm/RustWrapper.cpp
parent897199a0fbe01ab6f7e7f8096656603e238e85a2 (diff)
parent9249e6a1e2ef57bb6e329e6477beed31647236b1 (diff)
downloadrust-8f552181895921a377ab8c235340ea3d80ec7fc0.tar.gz
rust-8f552181895921a377ab8c235340ea3d80ec7fc0.zip
Auto merge of #31414 - durka:clone-copy, r=alexcrichton
special-case #[derive(Copy, Clone)] with a shallow clone

If a type is Copy then its Clone implementation can be a no-op. Currently `#[derive(Clone)]` generates a deep clone anyway. This can lead to lots of code bloat.

This PR detects the case where Copy and Clone are both being derived (the general case of "is this type Copy" can't be determined by a syntax extension) and generates the shallow Clone impl. Right now this can only be done if there are no type parameters (see https://github.com/rust-lang/rust/issues/31085#issuecomment-178988663), but this restriction can be removed after specialization.

Fixes #31085.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions