TrivialClone is not derived for generic types (Performance regression)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I used the "expand macros" button on the following code on the playground:
#[derive(Clone, Copy)]
struct Thing<T>(T);
I expected the expanded code to contain a TrivialClone impl of some sort, as per https://github.com/rust-lang/rust/pull/135634. Instead, there is no such impl.
cc @joboet
Meta
Reproducible on the playground with version 1.94.0-nightly (2025-12-06 ba86c0460b0233319e01)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the expansion of the generic Thing example in the Rust Playground using nightly 1.94.0 (2025-12-06 ba86c0460b0233319e01). Read the behavior described in PR 135634 and trace the compiler's derive expansion for Clone and Copy. Done means the expanded generic type includes the expected TrivialClone implementation without regressing the existing expansion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100