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 Copy and Clone for Handle<T> where T: !Copy #563

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gmorenz
Copy link
Contributor

@gmorenz gmorenz commented Mar 10, 2025

Derive only derives these impls for types where the generics satisfy them, but shared references (and thus Handle) can implement them for any type T.

I've run into this a few times while playing around now, because Cell doesn't implement Copy. It's not entirely clear that users of the library will run into this, but at worst it doesn't hurt to define these generally.

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
@gmorenz
Copy link
Contributor Author

gmorenz commented Mar 10, 2025

PS. It's also pretty likely that users will run into this if/when Handle is used more broadly. Right now the reason no one is running into this is because for the most part &/&mut referencess into RootedGuard are used.

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.

1 participant