Skip to content
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

Merged
merged 3 commits into from Dec 14, 2018
Merged

Fix write_with_newline escaping false positive #3531

merged 3 commits into from Dec 14, 2018

Conversation

ghost
Copy link

@ghost ghost commented Dec 11, 2018

Fixes #3514

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");
Copy link
Member

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?

@phansch phansch added the S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) label Dec 11, 2018
@ghost
Copy link
Author

ghost commented Dec 12, 2018

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

@phansch
Copy link
Member

phansch commented Dec 12, 2018

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 12, 2018

📌 Commit c6505aa has been approved by phansch

@bors
Copy link
Collaborator

bors commented Dec 12, 2018

⌛ Testing commit c6505aa with merge 25a4577...

bors added a commit that referenced this pull request Dec 12, 2018
Fix write_with_newline escaping false positive

Fixes #3514
@phansch
Copy link
Member

phansch commented Dec 12, 2018

Looks like a small .stderr update is needed after #3529

https://travis-ci.org/rust-lang/rust-clippy/jobs/466857163#L1076

@bors
Copy link
Collaborator

bors commented Dec 12, 2018

💔 Test failed - status-travis

@flip1995

This comment has been minimized.

@phansch
Copy link
Member

phansch commented Dec 14, 2018

@bors r+ thanks!

@bors
Copy link
Collaborator

bors commented Dec 14, 2018

📌 Commit be40d82 has been approved by phansch

@bors
Copy link
Collaborator

bors commented Dec 14, 2018

⌛ Testing commit be40d82 with merge fecc06c...

bors added a commit that referenced this pull request Dec 14, 2018
Fix write_with_newline escaping false positive

Fixes #3514
@phansch phansch removed the S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) label Dec 14, 2018
@phansch
Copy link
Member

phansch commented Dec 14, 2018

(The AppVeyor build seems to take a while to start: https://ci.appveyor.com/project/rust-lang-libs/rust-clippy/builds/21004552)

@bors
Copy link
Collaborator

bors commented Dec 14, 2018

💥 Test timed out

@phansch
Copy link
Member

phansch commented Dec 14, 2018

@bors retry

@bors
Copy link
Collaborator

bors commented Dec 14, 2018

⌛ Testing commit be40d82 with merge 17a9aff...

bors added a commit that referenced this pull request Dec 14, 2018
Fix write_with_newline escaping false positive

Fixes #3514
@bors
Copy link
Collaborator

bors commented Dec 14, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: phansch
Pushing 17a9aff to master...

@bors bors merged commit be40d82 into rust-lang:master Dec 14, 2018
@ghost ghost deleted the fix-3514 branch May 11, 2019 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants