-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Update where-clause position of generic associated types according to rust-lang issue #89122 #33
Conversation
… rust syntax (see rust issue #89122)
src/item.rs
Outdated
self.neverbreak(); | ||
self.ibox(-INDENT); | ||
self.ty(&item.ty); | ||
self.end(); | ||
self.word(";"); | ||
self.where_clause_oneline_semi(&item.generics.where_clause); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this change is correct. Where-clause is not allowed after the type on type aliases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow that's true. Reverted the code here.
src/item.rs
Outdated
self.neverbreak(); | ||
self.ty(default); | ||
self.where_clause_oneline_semi(&trait_item.generics.where_clause); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this line out of the if
block since it is identical to the other branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
where
clause position according to rust-lang issue #89122
Hello! 😀
When I'm using this formatter I noticed it's not yet supporting the recent rust's syntax update.
So I'm sending you a small patch to fix it. Thanks! 🙇
Sample diff from my code:
https://user-images.githubusercontent.com/1488411/210623996-300f6a29-f730-4e1d-a16f-d95133b66f91.png
(My test cases is not enough I think, I only tested the type alias in impl_item. But it's trivial so assume it's okay...)