-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Add MaybeDangling
#149614
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?
Add MaybeDangling
#149614
Conversation
This comment has been minimized.
This comment has been minimized.
def5b80 to
c428102
Compare
c428102 to
5bd5888
Compare
This comment has been minimized.
This comment has been minimized.
| #[stable(feature = "manually_drop", since = "1.20.0")] | ||
| impl<T: ?Sized + PartialEq> PartialEq for ManuallyDrop<T> { | ||
| fn eq(&self, other: &Self) -> bool { | ||
| self.value.as_ref().eq(other.value.as_ref()) | ||
| } | ||
| } |
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.
You also need to implement StructuralPartialEq, since ManuallyDrop in a const can currently be used in patterns on stable.
|
I don't know how much this is still an experiment, but if you're looking for more coverage, you might want to replace the rust/library/std/src/thread/lifecycle.rs Lines 61 to 82 in 864339a
|
This comment has been minimized.
This comment has been minimized.
1648a31 to
82d6d20
Compare
This comment has been minimized.
This comment has been minimized.
Now that `MaybeUninit` contains `ManuallyDrop` which contains `MaybeDangling` (tbc this is the addition), we need to unwrap one more layer
cc #118166