fitzgen requested cfallin for a review on PR #12519.
fitzgen opened PR #12519 from fitzgen:try-clone to bytecodealliance:main:
Part of https://github.com/bytecodealliance/wasmtime/issues/12069
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
fitzgen requested wasmtime-core-reviewers for a review on PR #12519.
fitzgen updated PR #12519.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Could this perhaps be
impl<T: Copy> TryClone for T?
fitzgen submitted PR review.
fitzgen created PR review comment:
FWIW, we would still need these implementations for tuples even with that blanket impl, so that something like
(Box<usize>, Vec<u8>), which is notCopy, could still implementTryClone.I did try to implement
TryClonefor allT: Copyand ran into conflicting trait impls. I guess because(T0, T1)might beCopyand Rust doesn't know whether to use the blanketCopyimpl or thewhere T0: TryClone, T1: TryCloneimpl?
fitzgen added PR #12519 Define a TryClone trait for cloning with fallible allocation to the merge queue.
fitzgen submitted PR review.
fitzgen created PR review comment:
(Enqueuing to merge now, if you know of a way to resolve this issue, we can do it in a follow up.)
fitzgen merged PR #12519.
fitzgen removed PR #12519 Define a TryClone trait for cloning with fallible allocation from the merge queue.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Ah yeah I thought coherence wouldn't trip up here but it's definitely tripping up, so definitely not possible
Last updated: Feb 24 2026 at 04:36 UTC