-
Notifications
You must be signed in to change notification settings - Fork 898
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
Generic associated impl trait type with bounds on self formatted to broken code #4911
Comments
Thanks for the report but I'm going to close this as a duplicate of various prior issues. It's been fixed in source but not pulled into a nightly release yet. |
Thanks for the response. I looked into other related closed issues (#4257 #4315 #4322) but they are from July 2020 and the examples from these issues are all formatted correctly with the current rustfmt version. So while this seems very similar, I don't think that this is a duplicate. The combination with the impl trait type alias seems to cause another problem. |
Ah I see now. The way the snippets were structured in the issue description was a bit of a misdirection. Would be helpful to update extend that initial snippet to a minimal repro itself (within the impl) since it's not reproducible as is. |
Updated initial example |
Describe the bug
When specifying an impl trait type alias for a generic associated type with a lifetime bound on
Self
, rustfmt will remove the bound, causing a compiler error, i.e.:will be changed to
To Reproduce
The following code compiles, but when running rustfmt on it it will remove the
Self
boundwhere Self" 'a
in the implementation for Foo leading to a compiler error:Expected behavior
The above code compiles and should not be formatted so it doesn't compile.
Meta
The text was updated successfully, but these errors were encountered: