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

use Span from ast::WhereClause when rewriting Structs #5693

Closed
wants to merge 1 commit into from

Conversation

ytmimi
Copy link
Contributor

@ytmimi ytmimi commented Feb 16, 2023

Fixes #5691

Through testing I observed that the Span from an ast::WhereClause was just as large as the span from ast::Generics when the struct was written without a where clause, and was larger when the struct was written with a where clause.

Hopefully the wide range of tests cases help to validate that as well!

r? @calebcartwright

Fixes 5691

Through testing I observed that the Span from an ast::WhereClause was
just as large as the span from `ast::Generics` when the struct was
written without a where clause, and was larger when the struct was
written with a where clause.
Copy link
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

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

Will leave it up to you as to which you'd rather merge, but fwiw idk how much the additional tests really add.

It's really more about the search needle, and whether that needle might exist somewhere before the actual one we're looking for, in this case the opening brace of the body. The extra tests may provide some future guards against other things, but for now 🤷

@ytmimi
Copy link
Contributor Author

ytmimi commented Feb 16, 2023

closing in favor of #5692

@ytmimi ytmimi closed this Feb 16, 2023
@ytmimi ytmimi deleted the issue_5691.rs branch February 16, 2023 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

duplicating where clauses that contains (unused) braces
2 participants