Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement shallow_clone for RObject/DynTrait #108

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

RustyYato
Copy link
Contributor

Fixes #107

Implement a shallow_clone function on RObject/DynTrait to allow cloning trait objects without cloning the underlying value.

@RustyYato
Copy link
Contributor Author

I opted for shallow_clone instead of cloned. Because in std, cloned is only used when you have a transformation like T<&U> -> T<U> where U: Clone. Which is a different operation.
I can't use clone since that would be a breaking change, so I picked a new name shallow_clone, which doesn't have some existing usage in std but better describes what's going on.

@rodrimati1992
Copy link
Owner

Looks alright.

@rodrimati1992
Copy link
Owner

rodrimati1992 commented Aug 1, 2023

Here's hoping that the the ICE that affects abi_stable gets fixed in the Rust beta channel that GitHub uses soon, because it's making more complex PRs unmergeable until it's fixed.

@rodrimati1992 rodrimati1992 merged commit 5bdad32 into rodrimati1992:master Aug 1, 2023
0 of 6 checks passed
@RustyYato
Copy link
Contributor Author

Yeah, I'm pinned to a June nightly to work around the ICE, hopefully, that gets fixed for beta!

@RustyYato RustyYato deleted the object-arc-clone branch August 1, 2023 21:45
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.

Object<.., RArc, ...> doesn't implement Clone
2 participants