-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make more tests rustfixable #4558
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fa96976
assign_ops: Remove MachineApplicable
Manishearth d513a0b
deref_addrof_double_trigger: Note why rustfix can't be used
Manishearth 49adc99
op_ref: Move tests out of eq_op file
Manishearth 38a34b1
eq_op: stop testing nonminimal_bool in same file
Manishearth bbfb9a4
for_loop: Split test into fixable/unfixable, make needless_range_loop…
Manishearth a2ab069
identity_conversion: make it use a rustfix test
Manishearth ee9e1af
implicit_return: make it use a rustfix test
Manishearth 2fecf75
inline_fn_without_body: make it use a rustfix page
Manishearth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,214 +1,166 @@ | ||
error: this boolean expression can be simplified | ||
--> $DIR/eq_op.rs:35:5 | ||
| | ||
LL | true && true; | ||
| ^^^^^^^^^^^^ help: try: `true` | ||
| | ||
= note: `-D clippy::nonminimal-bool` implied by `-D warnings` | ||
|
||
error: this boolean expression can be simplified | ||
--> $DIR/eq_op.rs:37:5 | ||
| | ||
LL | true || true; | ||
| ^^^^^^^^^^^^ help: try: `true` | ||
|
||
error: this boolean expression can be simplified | ||
--> $DIR/eq_op.rs:43:5 | ||
| | ||
LL | a == b && b == a; | ||
| ^^^^^^^^^^^^^^^^ help: try: `a == b` | ||
|
||
error: this boolean expression can be simplified | ||
--> $DIR/eq_op.rs:44:5 | ||
| | ||
LL | a != b && b != a; | ||
| ^^^^^^^^^^^^^^^^ help: try: `a != b` | ||
|
||
error: this boolean expression can be simplified | ||
--> $DIR/eq_op.rs:45:5 | ||
| | ||
LL | a < b && b > a; | ||
| ^^^^^^^^^^^^^^ help: try: `a < b` | ||
|
||
error: this boolean expression can be simplified | ||
--> $DIR/eq_op.rs:46:5 | ||
| | ||
LL | a <= b && b >= a; | ||
| ^^^^^^^^^^^^^^^^ help: try: `a <= b` | ||
|
||
error: equal expressions as operands to `==` | ||
--> $DIR/eq_op.rs:8:5 | ||
--> $DIR/eq_op.rs:9:5 | ||
| | ||
LL | 1 == 1; | ||
| ^^^^^^ | ||
| | ||
= note: `-D clippy::eq-op` implied by `-D warnings` | ||
|
||
error: equal expressions as operands to `==` | ||
--> $DIR/eq_op.rs:9:5 | ||
--> $DIR/eq_op.rs:10:5 | ||
| | ||
LL | "no" == "no"; | ||
| ^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `!=` | ||
--> $DIR/eq_op.rs:11:5 | ||
--> $DIR/eq_op.rs:12:5 | ||
| | ||
LL | false != false; | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `<` | ||
--> $DIR/eq_op.rs:12:5 | ||
--> $DIR/eq_op.rs:13:5 | ||
| | ||
LL | 1.5 < 1.5; | ||
| ^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `>=` | ||
--> $DIR/eq_op.rs:13:5 | ||
--> $DIR/eq_op.rs:14:5 | ||
| | ||
LL | 1u64 >= 1u64; | ||
| ^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `&` | ||
--> $DIR/eq_op.rs:16:5 | ||
--> $DIR/eq_op.rs:17:5 | ||
| | ||
LL | (1 as u64) & (1 as u64); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `^` | ||
--> $DIR/eq_op.rs:17:5 | ||
--> $DIR/eq_op.rs:18:5 | ||
| | ||
LL | 1 ^ ((((((1)))))); | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `<` | ||
--> $DIR/eq_op.rs:20:5 | ||
--> $DIR/eq_op.rs:21:5 | ||
| | ||
LL | (-(2) < -(2)); | ||
| ^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `==` | ||
--> $DIR/eq_op.rs:21:5 | ||
--> $DIR/eq_op.rs:22:5 | ||
| | ||
LL | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1)); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `&` | ||
--> $DIR/eq_op.rs:21:6 | ||
--> $DIR/eq_op.rs:22:6 | ||
| | ||
LL | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1)); | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `&` | ||
--> $DIR/eq_op.rs:21:27 | ||
--> $DIR/eq_op.rs:22:27 | ||
| | ||
LL | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1)); | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `==` | ||
--> $DIR/eq_op.rs:22:5 | ||
--> $DIR/eq_op.rs:23:5 | ||
| | ||
LL | (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `!=` | ||
--> $DIR/eq_op.rs:25:5 | ||
--> $DIR/eq_op.rs:26:5 | ||
| | ||
LL | ([1] != [1]); | ||
| ^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `!=` | ||
--> $DIR/eq_op.rs:26:5 | ||
--> $DIR/eq_op.rs:27:5 | ||
| | ||
LL | ((1, 2) != (1, 2)); | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `==` | ||
--> $DIR/eq_op.rs:30:5 | ||
--> $DIR/eq_op.rs:31:5 | ||
| | ||
LL | 1 + 1 == 2; | ||
| ^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `==` | ||
--> $DIR/eq_op.rs:31:5 | ||
--> $DIR/eq_op.rs:32:5 | ||
| | ||
LL | 1 - 1 == 0; | ||
| ^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `-` | ||
--> $DIR/eq_op.rs:31:5 | ||
--> $DIR/eq_op.rs:32:5 | ||
| | ||
LL | 1 - 1 == 0; | ||
| ^^^^^ | ||
|
||
error: equal expressions as operands to `-` | ||
--> $DIR/eq_op.rs:33:5 | ||
--> $DIR/eq_op.rs:34:5 | ||
| | ||
LL | 1 - 1; | ||
| ^^^^^ | ||
|
||
error: equal expressions as operands to `/` | ||
--> $DIR/eq_op.rs:34:5 | ||
--> $DIR/eq_op.rs:35:5 | ||
| | ||
LL | 1 / 1; | ||
| ^^^^^ | ||
|
||
error: equal expressions as operands to `&&` | ||
--> $DIR/eq_op.rs:35:5 | ||
--> $DIR/eq_op.rs:36:5 | ||
| | ||
LL | true && true; | ||
| ^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `||` | ||
--> $DIR/eq_op.rs:37:5 | ||
--> $DIR/eq_op.rs:38:5 | ||
| | ||
LL | true || true; | ||
| ^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `&&` | ||
--> $DIR/eq_op.rs:43:5 | ||
--> $DIR/eq_op.rs:44:5 | ||
| | ||
LL | a == b && b == a; | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `&&` | ||
--> $DIR/eq_op.rs:44:5 | ||
--> $DIR/eq_op.rs:45:5 | ||
| | ||
LL | a != b && b != a; | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `&&` | ||
--> $DIR/eq_op.rs:45:5 | ||
--> $DIR/eq_op.rs:46:5 | ||
| | ||
LL | a < b && b > a; | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `&&` | ||
--> $DIR/eq_op.rs:46:5 | ||
--> $DIR/eq_op.rs:47:5 | ||
| | ||
LL | a <= b && b >= a; | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: equal expressions as operands to `==` | ||
--> $DIR/eq_op.rs:49:5 | ||
--> $DIR/eq_op.rs:50:5 | ||
| | ||
LL | a == a; | ||
| ^^^^^^ | ||
|
||
error: taken reference of right operand | ||
--> $DIR/eq_op.rs:87:13 | ||
| | ||
LL | let z = x & &y; | ||
| ^^^^-- | ||
| | | ||
| help: use the right value directly: `y` | ||
| | ||
= note: `-D clippy::op-ref` implied by `-D warnings` | ||
|
||
error: equal expressions as operands to `/` | ||
--> $DIR/eq_op.rs:95:20 | ||
--> $DIR/eq_op.rs:60:20 | ||
| | ||
LL | const D: u32 = A / A; | ||
| ^^^^^ | ||
|
||
error: aborting due to 34 previous errors | ||
error: aborting due to 27 previous errors | ||
|
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is tested in another file? Everything else LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep