Skip to content

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

Merged
merged 1 commit into from
Jun 20, 2015
Merged

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Jun 19, 2015

@@ -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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe s/contain/own/?

Copy link
Contributor Author

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.

Copy link
Member

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).

Copy link
Member

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.)

Copy link
Member

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.

Copy link
Member

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 )

@Gankra
Copy link
Contributor Author

Gankra commented Jun 19, 2015

Updated text

@pnkfelix
Copy link
Member

@bors r+ e132f0b rollup

Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 20, 2015
bors added a commit that referenced this pull request Jun 20, 2015
@bors bors merged commit e132f0b into rust-lang:master Jun 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants