Skip to content

Conversation

@fitzgen
Copy link
Member

@fitzgen fitzgen commented Feb 4, 2026

Part of #12069

@fitzgen fitzgen requested a review from a team as a code owner February 4, 2026 16:29
@fitzgen fitzgen requested review from cfallin and removed request for a team February 4, 2026 16:29
A, B, C, D, E, F, G, H;
A, B, C, D, E, F, G, H, I;
A, B, C, D, E, F, G, H, I, J;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this perhaps be impl<T: Copy> TryClone for T?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, we would still need these implementations for tuples even with that blanket impl, so that something like (Box<usize>, Vec<u8>), which is not Copy, could still implement TryClone.

I did try to implement TryClone for all T: Copy and ran into conflicting trait impls. I guess because (T0, T1) might be Copy and Rust doesn't know whether to use the blanket Copy impl or the where T0: TryClone, T1: TryClone impl?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Enqueuing to merge now, if you know of a way to resolve this issue, we can do it in a follow up.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah I thought coherence wouldn't trip up here but it's definitely tripping up, so definitely not possible

@fitzgen fitzgen added this pull request to the merge queue Feb 4, 2026
Merged via the queue into bytecodealliance:main with commit b8e97b5 Feb 4, 2026
45 checks passed
@fitzgen fitzgen deleted the try-clone branch February 4, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants