-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Remove impl PinCoerceUnsized
for Pin
#144896
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
Conversation
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
Note that all other fundamental types that implement Note that this also means that making |
r? libs @bors2 try |
Remove impl `PinCoerceUnsized` for `Pin`
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
Seems like there are no real regressions. The openssl one it lists seems to be unrelated. |
@rustbot label +I-lang-nominated |
We talked about this in the lang call. Why does this remove the impl rather than taking one of the approaches that had seemed more favored in the discussion in #85099? |
You're right. Looking at this again I think the right solution is preventing the end-user from implementing |
The safety requirements for
PinCoerceUnsized
are essentially that the type does not have a maliciousDeref
orDerefMut
impl. However, thePin
type is fundamental, so the end-user can provide their own implementation ofDerefMut
forPin<&SomeLocalType>
, so it's possible forPin
to have a maliciousDerefMut
impl.Thus, remove the unsound implementation of
PinCoerceUnsized
for thePin
type.This PR is a breaking change, but it fixes #85099.