close
Skip to content

Test that you can't implement Unpin for a compiler-generated future using TAIT#157069

Open
Darksonn wants to merge 1 commit into
rust-lang:mainfrom
Darksonn:unpin-for-fut-tait
Open

Test that you can't implement Unpin for a compiler-generated future using TAIT#157069
Darksonn wants to merge 1 commit into
rust-lang:mainfrom
Darksonn:unpin-for-fut-tait

Conversation

@Darksonn
Copy link
Copy Markdown
Member

I came up with this while trying to break pinning. Seems like a good idea to have a test that this doesn't change.

r? @RalfJung

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 28, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 28, 2026

RalfJung is not on the review rotation at the moment.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

@Darksonn Darksonn force-pushed the unpin-for-fut-tait branch from 7023463 to 307310c Compare May 29, 2026 06:15
Comment on lines +19 to +20
impl Unpin for MyFut {}
//~^ ERROR: only traits defined in the current crate can be implemented for arbitrary types
Copy link
Copy Markdown
Member

@RalfJung RalfJung May 29, 2026

Choose a reason for hiding this comment

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

That's an odd error, the type is defined in the current trait.

Is there an attribute we can add to this impl so that it is allowed to unfold the opaque? Cc @oli-obk @lcnr

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All compiler-generated futures should probably come with an implicit impl !Unpin so that this doesn't rely on orphan rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants