rust-lang / rust-lang/rustfmt

Poor formatting of newline return types in existing tests

Open
#4,373 10 comments 0 reactions 1 assignee View on GitHub

@ayazhafiz is already working on this.

Since Aug 8, 2020.

C-bug
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

A number of our existing tests (targeting rustfmt on master) have poor formatting of return types that don't align with the changes made in #4368:

https://github.com/rust-lang/rustfmt/blob/f817383f9c3c4b5be9fdd77a034ba18dd3bd0da3/tests/target/issue-3278.rs#L1-L2

https://github.com/rust-lang/rustfmt/blob/f817383f9c3c4b5be9fdd77a034ba18dd3bd0da3/tests/target/long-fn-1.rs#L18-L19

https://github.com/rust-lang/rustfmt/blob/f817383f9c3c4b5be9fdd77a034ba18dd3bd0da3/tests/target/issue-2672.rs#L30-L31

https://github.com/rust-lang/rustfmt/blob/f817383f9c3c4b5be9fdd77a034ba18dd3bd0da3/tests/target/issue-2672.rs#L48-L49

I think these should be fixed to use return type indentation, a formatting regression fixed in #4368. These tests appear to have been added after that regression.

@topecongiro @calebcartwright if this sounds reasonable, feel free to assign me to this issue, I have some ideas of how to fix this and simplify the monolith function that handles function signature formatting (at least w.r.t. return types).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.