-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Forbid manual Unpin impls for structurally pinned types
#149263
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
base: main
Are you sure you want to change the base?
Conversation
|
The change itself seems simple, but I'd prefer to have someone from t-types review it. If no-one there feels like they have the capacity, feel free to assign it back to me. |
|
☔ The latest upstream changes (presumably #146348) made this pull request unmergeable. Please resolve the merge conflicts. |
f0b30c4 to
522ff7b
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
r? BoxyUwU |
| return Err(err.emit()); | ||
| } | ||
|
|
||
| // Disallow explicit impls of the `Unpin` trait for structurally pinned types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should live in a slightly difference place. This isn't enforcing anything related to the deny_explicit_impl stuff. It's also not really a general property of impls that we want to uphold- it's Unpin specific.
I think this should probably be a fn visit_implementation_of_unpin in coherehence/builtin.rs 🤔
|
What's the reason for wanting to forbid such |
|
It is for soundness concern. For a type |
|
If its soundness critical, I would add tests for impls of unpin for type aliases for adts marked pin_v2, e.g. rn your logic implicitly ignores all the cases where the self type is a non-adt 🤔 which I think is fine because we enforce that impls of |
Part of
pin_ergonomics. It forbids toimpl Unpin for TwhereTis an ADT marked with#[pin_v2].