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

Optimize code generation when used on enums #270

Merged
merged 1 commit into from
Sep 10, 2020
Merged

Optimize code generation when used on enums #270

merged 1 commit into from
Sep 10, 2020

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented Sep 8, 2020

When #[pin_project] is used on enums, only named projection types and methods are generated because there is no way to access variants of projected types without naming it. (When #[pin_project] is used on structs, both methods are always generated.)

Addresses #268 (comment)

@taiki-e taiki-e added A-pin-projection Area: #[pin_project] breaking-change This proposes a breaking change relnotes and removed relnotes labels Sep 8, 2020
@taiki-e taiki-e marked this pull request as draft September 8, 2020 16:22
@taiki-e taiki-e added this to the v1.0 milestone Sep 8, 2020
@taiki-e taiki-e marked this pull request as ready for review September 8, 2020 19:23
When `#[pin_project]` is used on enums, only named projection types and
methods are generated because there is no way to access variants of
projected types without naming it.
@taiki-e
Copy link
Owner Author

taiki-e commented Sep 10, 2020

bors r+

bors bot added a commit that referenced this pull request Sep 10, 2020
270: Optimize code generation when used on enums r=taiki-e a=taiki-e

When `#[pin_project]` is used on enums, only named projection types and methods are generated because there is no way to access variants of projected types without naming it. (When `#[pin_project]` is used on structs, both methods are always generated.)

Addresses #268 (comment)

Co-authored-by: Taiki Endo <[email protected]>
@bors
Copy link
Contributor

bors bot commented Sep 10, 2020

Build failed:

@taiki-e
Copy link
Owner Author

taiki-e commented Sep 10, 2020

bors retry

@bors
Copy link
Contributor

bors bot commented Sep 10, 2020

Build succeeded:

@bors bors bot merged commit 58b51c0 into master Sep 10, 2020
@bors bors bot deleted the enum branch September 10, 2020 09:20
@taiki-e taiki-e added the C-enhancement Category: A new feature or an improvement for an existing one label Sep 21, 2020
@taiki-e taiki-e removed the C-enhancement Category: A new feature or an improvement for an existing one label Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pin-projection Area: #[pin_project] breaking-change This proposes a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant