Fix write_with_newline escaping false positive#3531
Conversation
| 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.
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