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

tests/target: Add failing test for docstring in enum #6279

Conversation

malikolivier
Copy link

@malikolivier malikolivier commented Aug 13, 2024

For the time being, this PR only adds a failing test describing an unexpected behavior.

Issue

tests/target/rust-doc-in-enum/without-doc.rs is being left unformatted (expected behavior), while ``tests/target/rust-doc-in-enum/with-doc.rsis formatted toC { a: usize }` (unexpected behavior).

The only different between the two samples is the /// C rustdoc added in with-doc.rs.
As far as I can tell, this reproducing example is minimal: for example, after removing d: usize we do not reproduce the reported behavior.

I found this issue while adding rustdocs to an existing project. I would expect that adding a line of documentation should not cause the formatting of the code to change.

Follow instructions on Contributing.md [1] to create a test case.

[1] https://github.com/rust-lang/rustfmt/blob/40f507526993651ad3b92eda89d5b1cebd0ed374/Contributing.md#L33

`tests/target/rust-doc-in-enum/without-doc.rs` is being left unformatted
(expected behavior), while ``tests/target/rust-doc-in-enum/with-doc.rs`
is formatted to `C { a: usize }` (unexpected behavior).

The only different between the two samples is the `/// C` rustdoc added
in `with-doc.rs`.
As far as I can tell, this reproducing example is minimal: for example,
after removing `d: usize` we do not reproduce the reported behavior.

I found this issue while adding rustdocs to an existing project.
I would expect that adding a line of documentation should not cause the
formatting of the code to change.
@ytmimi
Copy link
Contributor

ytmimi commented Aug 14, 2024

Closing since this just demonstrates the issue already described in #6280

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.

3 participants