Multi-line diagnostic suggestions use LF in files that use CRLF line endings #119482
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
O-windows
Operating system: Windows
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Diagnostic suggestions that include line endings only use LF line endings. However, if the file is using CRLF line endings, applying the suggestion results in a file with mixed line endings.
I would expect that suggestions should match the line-ending style of the file.
For example:
generates JSON:
Notice that the
suggested_replacement
uses\n
despite the source file using\r\n
line endings.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: