-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Implement coercions between &pin (mut|const) T and &(mut) T when T: Unpin
#149130
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
This comment has been minimized.
This comment has been minimized.
29a89ae to
92596db
Compare
|
Some changes occurred in need_type_info.rs cc @lcnr Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in exhaustiveness checking cc @Nadrieril |
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
|
I am not a good person to review this. How about... r? @lcnr |
|
r? types |
|
r? types |
|
☔ The latest upstream changes (presumably #148602) made this pull request unmergeable. Please resolve the merge conflicts. |
92596db to
500d786
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. |
|
☔ The latest upstream changes (presumably #150115) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Incredibly sorry about the review latency here.
Overall, the changes look not bad. That being said, there are two very mechanical changes that would be useful to split into a separate PR (or really, a separate commit is fine, but I prefer a separate PR since they stand alone well).
| } | ||
|
|
||
| #[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)] | ||
| pub enum DerefAdjustKind { |
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.
(btw, small change that could be split out, but I like the addition of an enum even over Option)
| } | ||
| } | ||
|
|
||
| pub fn pinned_ref(self) -> Option<(Ty<'tcx>, ty::Mutability)> { |
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.
This deletion, can you too split into a separate PR?
|
Reminder, once the PR becomes ready for a review, use |
This allows the following (mutual) coercions when
T: Unpin:&T<->Pin<&T>&mut T<->Pin<&mut T>&mut T->Pin<&T>Pin<&mut T>->&TPart of Pin Ergonomics.