Skip to content

fix: Keep comments and attrs when extracting struct from enum variant #8802

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

Conversation

DropDemBits
Copy link
Contributor

Fixes #6730

Still unsure if existing visibilities of fields should be forced to pub (which is what was previously done), or if it's okay to keep it in the extracted struct.

@DropDemBits DropDemBits force-pushed the fix-extract-struct-from-enum-variant branch from 6bef398 to 7fefac4 Compare May 11, 2021 15:08
@DropDemBits DropDemBits marked this pull request as ready for review May 11, 2021 15:08
@Veykril
Copy link
Member

Veykril commented May 12, 2021

I imagine pub was always unconditionally inserted as you wouldn't usually have vis mods on variants/variant fields since they are only allowed for parsing but rejected later one. In the end this shouldn't make a difference therefore since we don't generate incorrect code in the end. So this change seems fine to me.

bors r+

@bors
Copy link
Contributor

bors bot commented May 12, 2021

@bors bors bot merged commit 1c927d2 into rust-lang:master May 12, 2021
@Veykril Veykril changed the title Keep comments and attrs when extracting struct from enum variant fix: Keep comments and attrs when extracting struct from enum variant May 12, 2021
@lnicola
Copy link
Member

lnicola commented May 12, 2021

changelog fix (first contribution) keep comments and attributes when extracting struct from enum variant.

@DropDemBits DropDemBits deleted the fix-extract-struct-from-enum-variant branch August 31, 2021 00:42
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.

"Extract struct from enum variant" drops code comments and attributes of members
3 participants