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

Extensions has over restrictive bounds. #728

Closed
carloskiki opened this issue Nov 26, 2024 · 1 comment
Closed

Extensions has over restrictive bounds. #728

carloskiki opened this issue Nov 26, 2024 · 1 comment

Comments

@carloskiki
Copy link

Inserting and removing from a Extensions map should not require Clone or Sync. We never access a reference to the stored value, and we never clone it, hence I do not see why Extensions requires these bounds.

I came across this issue as I wanted to store a oneshot::Sender that is not Clone nor Sync for good reasons.

@sfackler
Copy link
Contributor

sfackler commented Nov 26, 2024

Extensions erases the types inside of it. If it did not require all types to be Send and Clone, it could not be Send or Clone itself. See #395 for why the Clone bound was added in 1.0.

@seanmonstar seanmonstar closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2024
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

No branches or pull requests

3 participants