Skip to content
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

#![feature(overlapping_marker_traits)] breaks the guarantee for Unpin provided by pin-project #105

Closed
taiki-e opened this issue Sep 24, 2019 · 4 comments · Fixed by #182
Closed
Labels
A-unpin Area: Unpin and UnsafeUnpin C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream) I-unsound A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness requires-nightly This issue requires a nightly compiler in some way

Comments

@taiki-e
Copy link
Owner

taiki-e commented Sep 24, 2019

UPDATE2(2020/01/27):

This will be fixed in rust-lang/rust#68544


UPDATE(2019/09/26):

overlapping_marker_traits is replaced with marker_trait_attr.
marker_trait_attr doesn't seem to break the guarantee (added test in #110). So, once overlapping_marker_traits is removed, close this issue.


pin-project provides an appropriate Unpin implementation by default. Since overlapping implementations are prohibited, this ensures that users cannot add inappropriate Unpin implementations.

However, currently, this guarantee can be broken by enabling #[feature(overlapping_marker_traits)]: playground

@cramertj has already pointed out this in rust-lang/rust#29864 (comment).
And it seems that it is planned to make #[feature(overlapping_marker_traits)] available only with explicitly allowed traits, but it doesn't seem to be fully implemented yet.


Thanks to @RalfJung for pointing out the interaction with this feature.

@taiki-e taiki-e added C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream) requires-nightly A-unpin Area: Unpin and UnsafeUnpin labels Sep 24, 2019
@scottmcm
Copy link

The gate for the new behavior is https://doc.rust-lang.org/nightly/unstable-book/language-features/marker-trait-attr.html -- it was implemented in parallel without removing the old feature.

@taiki-e
Copy link
Owner Author

taiki-e commented Sep 26, 2019

@scottmcm Thanks! I think I missed it.

However, even if it is deprecated, it breaks soundness, so I believe that it makes sense to leave this issue open until the feature is removed.

bors bot added a commit that referenced this issue Sep 26, 2019
110: Add ui test for marker_trait_attr feature r=taiki-e a=taiki-e

cc #105 

Co-authored-by: Taiki Endo <te316e89@gmail.com>
@taiki-e
Copy link
Owner Author

taiki-e commented Jan 27, 2020

This will be fixed in rust-lang/rust#68544 (Thanks @Aaron1011!)

@Aaron1011
Copy link
Collaborator

Aaron1011 commented Feb 5, 2020

Now that rust-lang/rust#68544 has been merged, I believe that this issue can be closed.

@taiki-e taiki-e mentioned this issue Feb 6, 2020
@bors bors bot closed this as completed in 88add31 Feb 6, 2020
@bors bors bot closed this as completed in #182 Feb 6, 2020
@taiki-e taiki-e added the I-unsound A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness label Apr 21, 2020
@taiki-e taiki-e added the requires-nightly This issue requires a nightly compiler in some way label Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-unpin Area: Unpin and UnsafeUnpin C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream) I-unsound A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness requires-nightly This issue requires a nightly compiler in some way
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants