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

Don't project if you require Unpin. #12

Merged
merged 1 commit into from Mar 10, 2020

Conversation

najamelan
Copy link
Contributor

@najamelan najamelan commented Mar 10, 2020

This doesn't make sense. For Unpin types, Pin does nothing, so Pin::new() is sufficient.

However Pin::new is only implemented for `Pin<P> where <P as Deref>::Target: Unpin`, so if it weren't Unpin,
you would have to use unsafe { Pin::new_unchecked(s) }, `Pin::new()` wouldn't compile.

Thus project and Pin::new together is always a code smell.
@sdroege sdroege merged commit bfbb940 into sdroege:master Mar 10, 2020
@sdroege
Copy link
Owner

sdroege commented Mar 10, 2020

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants