-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Always implement Unpin for PhantomData #62786
Conversation
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
It's on purpose for In my opinion, it's probably better to keep the same with |
r? @cramertj perhaps? Not sure who the "owners" in this space are today. |
Is it? Where was that ratified? Do we have tests to ensure this continues to hold?
Seems like an invalid pattern to me, at least in vacuum. It is not semver breaking to add additional impls for That being said, if it does have a widespread usage and this behaviour is not yet ratified in e.g. documentation, we may want to ratify it sooner rather than later. |
Here's the first one I found in libstd: rust/src/libstd/sys/unix/args.rs Line 25 in fe499a7
|
It's worth mentioning the |
Either way, I think we either document/ratify |
I guess we can close as wont-fix. |
This PR makes it so that
PhantomData<T>
implementsUnpin
no matter whatT
is.Interestingly enough, the situation is the same for
Send
andSync
.PhantomData
only implementsSend
ifT: Send
andSync
ifT: Sync
. I don't know whether that's on purpose, or if it's an overlook.