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

more tiny clippy cleanups #77037

Merged
merged 2 commits into from
Sep 30, 2020
Merged

more tiny clippy cleanups #77037

merged 2 commits into from
Sep 30, 2020

Conversation

matthiaskrgr
Copy link
Member

commits stand alone and can be reviewed one by one

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 21, 2020
@Dylan-DPC-zz
Copy link

Dylan-DPC-zz commented Sep 22, 2020

r? @Dylan-DPC

ui tests need to be updated (missing a --bless i guess :P )

compiler/rustc_metadata/src/rmeta/decoder.rs Outdated Show resolved Hide resolved
compiler/rustc_ast_pretty/src/pprust.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_pretty/src/lib.rs Outdated Show resolved Hide resolved
@@ -77,9 +77,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
let res = match bin_op {
Eq => l == r,
Ne => l != r,
Lt => l < r,
Lt => !l & r, // equals l < r
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't there be an allow here instead of the new code?

  1. regardless whether you think whether l < r is clearer than !l & r or not, this specific piece of code concerns the implementation of l < r in the constant evaluator. I think it's most clear to implement l < r via l < r instead via something that clippy thinks is better.

  2. If l < r should be replaced with not and and operations, why not l <= r as well?

The bool comparison lint description in clippy's docs makes sense, x < true is code smell. But x < y in an implementation of x < y is IMO not.

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, I removed changes from the pr.
Sprinkling the rustc code with clippy allow attributes is probably something most people would object though.

@Dylan-DPC-zz
Copy link

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 23, 2020

📌 Commit 7fc36998fc7d53e444de570764196eacb2594769 has been approved by Dylan-DPC

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 23, 2020
@bors
Copy link
Contributor

bors commented Sep 24, 2020

☔ The latest upstream changes (presumably #77102) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 24, 2020
@matthiaskrgr
Copy link
Member Author

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 24, 2020
@Dylan-DPC-zz
Copy link

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 30, 2020

📌 Commit d7a5c57 has been approved by Dylan-DPC

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 30, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 30, 2020
more tiny clippy cleanups

commits stand alone and can be reviewed one by one
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 30, 2020
…as-schievink

Rollup of 12 pull requests

Successful merges:

 - rust-lang#77037 (more tiny clippy cleanups)
 - rust-lang#77233 (BTreeMap: keep an eye out on the size of the main components)
 - rust-lang#77280 (Ensure that all LLVM components requested by tests are available on CI)
 - rust-lang#77284 (library: Forward compiler-builtins "mem" feature)
 - rust-lang#77296 (liveness: Use Option::None to represent absent live nodes)
 - rust-lang#77322 (Add unstable book docs for `-Zunsound-mir-opts`)
 - rust-lang#77328 (Use `rtassert!` instead of `assert!` from the child process after fork() in std::sys::unix::process::Command::spawn())
 - rust-lang#77331 (Add test for async/await combined with const-generics.)
 - rust-lang#77338 (Fix typo in alloc vec comment)
 - rust-lang#77340 (Alloc vec use imported path)
 - rust-lang#77345 (Add test for issue rust-lang#74761)
 - rust-lang#77348 (Update books)

Failed merges:

r? `@ghost`
@bors bors merged commit 248d6bf into rust-lang:master Sep 30, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants