-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix write_with_newline escaping false positive #3531
Conversation
tests/ui/write_with_newline.stderr
Outdated
error: using `write!()` with a format string that ends in a single newline, consider using `writeln!()` instead | ||
--> $DIR/write_with_newline.rs:44:5 | ||
| | ||
44 | write!(&mut v, "//n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand it correctly that this lint output actually originates from write!(&mut v, "\\\n");
in line 44?
Yes. That warning is correct because the format string ends in backslash and newline. The stderr file has double forward slashes because compile test normalizes output by first by replacing double backslash with backslash and then backslash with forward slash. https://github.com/laumann/compiletest-rs/blob/25b681f06935ff697c5736fa85dd32af695b5e69/src/runtest.rs#L2456 |
@bors r+ rollup |
📌 Commit c6505aa has been approved by |
Fix write_with_newline escaping false positive Fixes #3514
Looks like a small .stderr update is needed after #3529 https://travis-ci.org/rust-lang/rust-clippy/jobs/466857163#L1076 |
💔 Test failed - status-travis |
This comment has been minimized.
This comment has been minimized.
@bors r+ thanks! |
📌 Commit be40d82 has been approved by |
Fix write_with_newline escaping false positive Fixes #3514
(The AppVeyor build seems to take a while to start: https://ci.appveyor.com/project/rust-lang-libs/rust-clippy/builds/21004552) |
💥 Test timed out |
@bors retry |
Fix write_with_newline escaping false positive Fixes #3514
☀️ Test successful - status-appveyor, status-travis |
Fixes #3514