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

1.x: Preserve and format type aliases in extern blocks #4447

Merged
merged 4 commits into from
Oct 2, 2020
Merged

1.x: Preserve and format type aliases in extern blocks #4447

merged 4 commits into from
Oct 2, 2020

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Oct 1, 2020

This is a straightforward backport of #4164 to resolve rustfmt deleting important code when using the cxx crate; see dtolnay/cxx#330 (comment).

Previously, non-trivial type aliases in extern blocks were dropped by
rustfmt because only the type alias name would be passed to a rewritter.
This commit fixes that by passing all type information (generics,
bounds, and assignments) to a type alias rewritter, and consolidates
`rewrite_type_alias` and `rewrite_associated_type` as one function.
@adetaylor
Copy link

This would be useful for me as well. Thanks for the backport.

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