diff options
| author | bors <bors@rust-lang.org> | 2016-04-26 14:54:37 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-04-26 14:54:37 -0700 |
| commit | 8f552181895921a377ab8c235340ea3d80ec7fc0 (patch) | |
| tree | 92395c4d4b72986babdc2b9e53646229c39cccc1 /src/rustllvm/RustWrapper.cpp | |
| parent | 897199a0fbe01ab6f7e7f8096656603e238e85a2 (diff) | |
| parent | 9249e6a1e2ef57bb6e329e6477beed31647236b1 (diff) | |
| download | rust-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
