-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Pretty printing should use \r\n on Windows. #14808
Comments
I don't really think the source code format should vary across platforms. Using UTF-8 with consistent line endings everywhere works fine and it means the files are portable across operating systems. |
Nonetheless, text editors on windows all use \r\n so having mixed \n and \r\n isn't any better, nevermind some editors don't even display \n correctly. |
This likely depends on #14400 being merged first. |
Did anyone ever consider having stdout convert LF to CRLF automatically on Windows? |
#24696 generated enough resistance that I think we should not pursue this. I'm not sure how to get to a decision, but it'd be nice to lock this down. |
Triage: no changes in the last two years. @rust-lang/compiler and @rust-lang/lang , do you have any thoughts here? There was a PR for this, but it was closed in favor of gaining some kind of consensus. |
I personally don't have any problem emitting That said, I think the proper comparison for |
The pretty printer is incredibly useful for debugging macros, but that's really about it. I don't care anymore about the choice of line ending for pretty printing, and rustfmt takes care of formatting code. I just want the pretty printer to be polished as a proper macro debugging tool, the equivalent of preprocessing only in C++. |
Which team does the decision needed fall to for this? |
Closing. I personally think this is not something that we should settle on long-running issues and it seems no one cares too much about this today. |
Add metrics for unevaluated constants, failed mir bodies, and failed data layouts fix rust-lang#14803
On Windows the preferred line ending is \r\n, not \n like it is on posix platforms.
Unfortunately using --pretty with rustc outputs \n newlines.
For comparison clang-format outputs \r\n on Windows.
The text was updated successfully, but these errors were encountered: