format_code_in_doc_comments makes multiline comments invalid #4421
Labels
a-comments
bug
Panic, non-idempotency, invalid code, etc.
only-with-option
requires a non-default option value to reproduce
Describe the bug
All this happens only with
format_code_in_doc_comments=true
.This is a follow up issue of #4420. When reformatting the output of that issue, another issue occurs. Two subsequent multiline comments (
/* */
), though in one line each, are transformed to invalid syntax as the opening indicator/*
of the second line gets transformed to an asterisk*
only.To Reproduce
I use the (wrong) output from #4420 as basis and make it even more minimal (it can also be reproduced with the full output of that issue). When running the code blow with
rustfmt --config format_code_in_doc_comments=true
The output is:
That is even invalid syntax.
Expected behavior
I would expect that the code is untouched by
rustfmt
.Meta
rustfmt
, but it also happens withcargo fmt
The text was updated successfully, but these errors were encountered: