-
Notifications
You must be signed in to change notification settings - Fork 13.4k
add note for future type-system adventurers #26439
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
Conversation
@@ -512,6 +512,8 @@ impl<T: ?Sized> PartialOrd for *mut T { | |||
#[unstable(feature = "unique", reason = "needs an RFC to flesh out design")] | |||
pub struct Unique<T: ?Sized> { | |||
pointer: NonZero<*const T>, | |||
// NOTE: this marker has no consequences for variance, but is necessary | |||
// for dropck to understand that we logically contain a `T`. |
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.
maybe s/contain/own/?
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'm actually not sure which dropck really cares about.
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.
Ownership (i.e. when destructors run).
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.
(Well, maybe that's not precisely right, since Unique
doesn't actually drop its T
. I guess @pnkfelix will have to clarify.)
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.
Ownership is right; it doesn't matter that Unique doesn't drop its T
itself -- dropck
thinks it does.
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.
(having said that, I have no problem with using the word "contain" here. The one thing you might do is link to the relevant part of RFC, namely: https://github.com/rust-lang/rfcs/blob/master/text/0769-sound-generic-drop.md#phantom-data )
Updated text |
r? @pnkfelix