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

Remove empty "where" clauses #4001

Closed
goffrie opened this issue Jan 6, 2020 · 0 comments · Fixed by #4175
Closed

Remove empty "where" clauses #4001

goffrie opened this issue Jan 6, 2020 · 0 comments · Fixed by #4175

Comments

@goffrie
Copy link
Contributor

goffrie commented Jan 6, 2020

rustfmt leaves fn foo() -> () where {} as-is, when it should ideally remove the where. However, it does change fn foo() where {} to fn foo() {}.

ayazhafiz added a commit to ayazhafiz/rustfmt that referenced this issue May 13, 2020
rustfmt tries to preserve the comment between a fn return type and the
start of the fn body if there are no where clauses following the return
type. However, even if there are no where clauses present, the "where"
keyword may be. To elide the "where" keyword in this context, just get
the comment snippet starting after the where clause span, which always
includes the "where" keyword if present.

Closes rust-lang#4001
topecongiro pushed a commit that referenced this issue May 16, 2020
rustfmt tries to preserve the comment between a fn return type and the
start of the fn body if there are no where clauses following the return
type. However, even if there are no where clauses present, the "where"
keyword may be. To elide the "where" keyword in this context, just get
the comment snippet starting after the where clause span, which always
includes the "where" keyword if present.

Closes #4001
bradleypmartin pushed a commit to bradleypmartin/rustfmt that referenced this issue May 25, 2020
rustfmt tries to preserve the comment between a fn return type and the
start of the fn body if there are no where clauses following the return
type. However, even if there are no where clauses present, the "where"
keyword may be. To elide the "where" keyword in this context, just get
the comment snippet starting after the where clause span, which always
includes the "where" keyword if present.

Closes rust-lang#4001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants