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
Open

ManuallyDrop causes pinning to be unsound? #52

asajeffrey opened this issue Jan 31, 2018 · 5 comments

Comments

@asajeffrey
Copy link
Owner

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
Copy link
Owner Author

@asajeffrey
Copy link
Owner Author

@asajeffrey
Copy link
Owner Author

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

@asajeffrey
Copy link
Owner Author

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

@asajeffrey
Copy link
Owner Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant