Skip to content

Fix write_with_newline escaping false positive - #3531

Merged
bors merged 3 commits into
masterfrom
unknown repository
Dec 14, 2018
Merged

Fix write_with_newline escaping false positive#3531
bors merged 3 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Dec 11, 2018

Copy link
Copy Markdown

Fixes #3514

Comment thread 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");

Copy link
Copy Markdown
Contributor

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

ghost commented Dec 12, 2018

Copy link
Copy Markdown
Author

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

phansch commented Dec 12, 2018

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Dec 12, 2018

Copy link
Copy Markdown
Contributor

📌 Commit c6505aa has been approved by phansch

@bors

bors commented Dec 12, 2018

Copy link
Copy Markdown
Contributor

⌛ 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

phansch commented Dec 12, 2018

Copy link
Copy Markdown
Contributor

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

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

@bors

bors commented Dec 12, 2018

Copy link
Copy Markdown
Contributor

💔 Test failed - status-travis

@flip1995

This comment has been minimized.

@phansch

phansch commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

@bors r+ thanks!

@bors

bors commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

📌 Commit be40d82 has been approved by phansch

@bors

bors commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

⌛ 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

phansch commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

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

@bors

bors commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

💥 Test timed out

@phansch

phansch commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

@bors retry

@bors

bors commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

⌛ 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

bors commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

☀️ 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