Skip to content

TrivialClone is not derived for generic types (Performance regression) #149752

@theemathas

Description

@theemathas

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 #135634. Instead, there is no such impl.

cc @joboet

Meta

Reproducible on the playground with version 1.94.0-nightly (2025-12-06 ba86c0460b0233319e01)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-specializationArea: Trait impl specializationC-bugCategory: This is a bug.I-libs-nominatedNominated for discussion during a libs team meeting.I-prioritizeIssue: Indicates that prioritization has been requested for this issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions