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

ManuallyDrop causes pinning to be unsound? #52

Open
asajeffrey opened this Issue Jan 31, 2018 · 5 comments

Comments

Projects
None yet
1 participant
@asajeffrey
Copy link
Owner

asajeffrey commented Jan 31, 2018

ManuallyDrop<Pin<T>> causes Pin<T> not to call its destructor, oh dear. This is different from mem::forget(T) because that has to be called after the pinning (so the borrowchecker will complain about lifetimes) whereas ManuallyDrop::new is called before. Sigh.

@asajeffrey

This comment has been minimized.

Copy link
Owner Author

asajeffrey commented Feb 1, 2018

@asajeffrey

This comment has been minimized.

Copy link
Owner Author

asajeffrey commented Feb 1, 2018

And yet more, this time with a possible solution! https://mozilla.logbot.info/servo/20180201#c14230291

@asajeffrey

This comment has been minimized.

Copy link
Owner Author

asajeffrey commented Feb 1, 2018

A very rough draft of what a fixed API would look like: https://play.rust-lang.org/?gist=6791dbfd630b20c8cabda5511e43e089&version=stable

@asajeffrey

This comment has been minimized.

Copy link
Owner Author

asajeffrey commented Feb 2, 2018

Posted a "lessons learned" message to the unsafe code guidelines discussion forum: https://internals.rust-lang.org/t/rust-1-20-caused-pinning-to-become-incorrect/6695

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.