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

#4542 remove machine applicable suggestion #4544

Merged
merged 1 commit into from
Sep 19, 2019

Conversation

JoshMcguigan
Copy link
Contributor

@JoshMcguigan JoshMcguigan commented Sep 15, 2019

This helps #4542 (but does not completely resolve) by removing the machine applicable suggestion (which was incorrect) for that case.

I would have preferred to fix the machine applicable suggestion to handle format strings, but that's a bit beyond my current understanding of the clippy codebase. I'd be happy to give it a try given some guidance.

changelog: only produce machine applicable suggestions on explicit_write lint

@JoshMcguigan
Copy link
Contributor Author

I believe the CI run is failing because the "fixed" code doesn't compile, because it still warns on explicit_write. That is expected since the lint in this case is not machine applicable. Is there a workaround for this?

@flip1995
Copy link
Member

Thanks! Can you remove the Resolves from the PR body, since it only disables the suggestion and doesn't fix it.

Regarding the run-rustfix problem: You can extract the non-autofixable test to an extra file. (Maybe there already exists one for this lint)

@flip1995
Copy link
Member

On how to fix it: The writeln! macro expands to a match statement, with some call. Some parts of this statement already gets matched in the function you modified. To get the format strings you have to do a little more matching. I know that there is a lint which does something like this, but I don't know which one exactly.

@JoshMcguigan JoshMcguigan force-pushed the issue-4542 branch 4 times, most recently from 1bf5a76 to 5ff1d38 Compare September 17, 2019 01:27
@JoshMcguigan JoshMcguigan changed the title resolve #4542 by removing machine applicable suggestion #4542 remove machine applicable suggestion Sep 17, 2019
@JohnTitor
Copy link
Member

We should also remove resolve keyword from the commit message otherwise the original issue will be closed.

@JoshMcguigan
Copy link
Contributor Author

@JohnTitor I've updated the commit message, thanks for pointing this out.

Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Waiting for rustup

@flip1995
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 19, 2019

📌 Commit 24ec994 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Sep 19, 2019

⌛ Testing commit 24ec994 with merge b1f45bc...

bors added a commit that referenced this pull request Sep 19, 2019
#4542 remove machine applicable suggestion

This helps #4542 (but does not completely resolve) by removing the machine applicable suggestion (which was incorrect) for that case.

I would have preferred to fix the machine applicable suggestion to handle format strings, but that's a bit beyond my current understanding of the clippy codebase. I'd be happy to give it a try given some guidance.
flip1995 added a commit to flip1995/rust-clippy that referenced this pull request Sep 19, 2019
rust-lang#4542 remove machine applicable suggestion

This helps rust-lang#4542 (but does not completely resolve) by removing the machine applicable suggestion (which was incorrect) for that case.

I would have preferred to fix the machine applicable suggestion to handle format strings, but that's a bit beyond my current understanding of the clippy codebase. I'd be happy to give it a try given some guidance.
@bors
Copy link
Contributor

bors commented Sep 19, 2019

💔 Test failed - checks-travis

@flip1995
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 19, 2019

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: New lint: mem_replace_with_uninit #4511

@bors
Copy link
Contributor

bors commented Sep 19, 2019

📌 Commit 24ec994 has been approved by flip1995

flip1995 added a commit to flip1995/rust-clippy that referenced this pull request Sep 19, 2019
rust-lang#4542 remove machine applicable suggestion

This helps rust-lang#4542 (but does not completely resolve) by removing the machine applicable suggestion (which was incorrect) for that case.

I would have preferred to fix the machine applicable suggestion to handle format strings, but that's a bit beyond my current understanding of the clippy codebase. I'd be happy to give it a try given some guidance.

changelog: only produce machine applicable suggestions on `explicit_write` lint
bors added a commit that referenced this pull request Sep 19, 2019
Rollup of 4 pull requests

Successful merges:

 - #4511 (New lint: mem_replace_with_uninit)
 - #4535 (New lint: Require `# Safety` section in pub unsafe fn docs)
 - #4539 (Changes cast-lossless to a pedantic lint)
 - #4544 (#4542 remove machine applicable suggestion)

Failed merges:

r? @ghost

changelog: none
bors added a commit that referenced this pull request Sep 19, 2019
#4542 remove machine applicable suggestion

This helps #4542 (but does not completely resolve) by removing the machine applicable suggestion (which was incorrect) for that case.

I would have preferred to fix the machine applicable suggestion to handle format strings, but that's a bit beyond my current understanding of the clippy codebase. I'd be happy to give it a try given some guidance.

changelog: only produce machine applicable suggestions on `explicit_write` lint
@bors
Copy link
Contributor

bors commented Sep 19, 2019

⌛ Testing commit 24ec994 with merge cdaa93d...

@bors
Copy link
Contributor

bors commented Sep 19, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing cdaa93d to master...

@bors bors merged commit 24ec994 into rust-lang:master Sep 19, 2019
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.

4 participants