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

Work around negative_impls that allows unsound overlapping Unpin impls #357

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented Oct 24, 2024

See #340 (comment) for details of the workaround.

(Btw, lifetime to workaround trivial_bounds is still needed.)

Fixes #340

@taiki-e taiki-e added the A-unpin Area: Unpin and UnsafeUnpin label Oct 24, 2024
@taiki-e taiki-e merged commit f6c7504 into main Oct 24, 2024
10 checks passed
@taiki-e taiki-e deleted the negative_impls branch October 24, 2024 11:48
@danielhenrymantilla
Copy link

(Btw, lifetime to workaround trivial_bounds is still needed.)

Yeah, the other approach, but not worth changing your code for at the moment, would have been to emit for<'__trivial> Type<…> : Bounds…. That avoids the "trivially false" errors, much like I did over #340 with my for<'never> str : Sized.

This is more of an FYI should the current "unconstrained lifetime" be to become an error in some future version of Rust, again, not suggesting that you change the current "floating" '__pin design

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-unpin Area: Unpin and UnsafeUnpin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#![feature(negative_impls)] breaks the guarantee for Unpin provided by pin-project
2 participants