Skip to content

Fix ui tests #1899

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

Merged
merged 1 commit into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions clippy_tests/examples/assign_ops.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,137 +2,137 @@ error: assign operation detected
--> assign_ops.rs:8:5
|
8 | i += 2;
| ^^^^^^ help: replace it with `i = i + 2`
| ^^^^^^ help: replace it with: `i = i + 2`
|
= note: `-D assign-ops` implied by `-D warnings`

error: assign operation detected
--> assign_ops.rs:9:5
|
9 | i += 2 + 17;
| ^^^^^^^^^^^ help: replace it with `i = i + 2 + 17`
| ^^^^^^^^^^^ help: replace it with: `i = i + 2 + 17`

error: assign operation detected
--> assign_ops.rs:10:5
|
10 | i -= 6;
| ^^^^^^ help: replace it with `i = i - 6`
| ^^^^^^ help: replace it with: `i = i - 6`

error: assign operation detected
--> assign_ops.rs:11:5
|
11 | i -= 2 - 1;
| ^^^^^^^^^^ help: replace it with `i = i - (2 - 1)`
| ^^^^^^^^^^ help: replace it with: `i = i - (2 - 1)`

error: assign operation detected
--> assign_ops.rs:12:5
|
12 | i *= 5;
| ^^^^^^ help: replace it with `i = i * 5`
| ^^^^^^ help: replace it with: `i = i * 5`

error: assign operation detected
--> assign_ops.rs:13:5
|
13 | i *= 1+5;
| ^^^^^^^^ help: replace it with `i = i * (1+5)`
| ^^^^^^^^ help: replace it with: `i = i * (1+5)`

error: assign operation detected
--> assign_ops.rs:14:5
|
14 | i /= 32;
| ^^^^^^^ help: replace it with `i = i / 32`
| ^^^^^^^ help: replace it with: `i = i / 32`

error: assign operation detected
--> assign_ops.rs:15:5
|
15 | i /= 32 | 5;
| ^^^^^^^^^^^ help: replace it with `i = i / (32 | 5)`
| ^^^^^^^^^^^ help: replace it with: `i = i / (32 | 5)`

error: assign operation detected
--> assign_ops.rs:16:5
|
16 | i /= 32 / 5;
| ^^^^^^^^^^^ help: replace it with `i = i / (32 / 5)`
| ^^^^^^^^^^^ help: replace it with: `i = i / (32 / 5)`

error: assign operation detected
--> assign_ops.rs:17:5
|
17 | i %= 42;
| ^^^^^^^ help: replace it with `i = i % 42`
| ^^^^^^^ help: replace it with: `i = i % 42`

error: assign operation detected
--> assign_ops.rs:18:5
|
18 | i >>= i;
| ^^^^^^^ help: replace it with `i = i >> i`
| ^^^^^^^ help: replace it with: `i = i >> i`

error: assign operation detected
--> assign_ops.rs:19:5
|
19 | i <<= 9 + 6 - 7;
| ^^^^^^^^^^^^^^^ help: replace it with `i = i << (9 + 6 - 7)`
| ^^^^^^^^^^^^^^^ help: replace it with: `i = i << (9 + 6 - 7)`

error: assign operation detected
--> assign_ops.rs:20:5
|
20 | i += 1 << 5;
| ^^^^^^^^^^^ help: replace it with `i = i + (1 << 5)`
| ^^^^^^^^^^^ help: replace it with: `i = i + (1 << 5)`

error: manual implementation of an assign operation
--> assign_ops.rs:27:5
|
27 | a = a + 1;
| ^^^^^^^^^ help: replace it with `a += 1`
| ^^^^^^^^^ help: replace it with: `a += 1`
|
= note: `-D assign-op-pattern` implied by `-D warnings`

error: manual implementation of an assign operation
--> assign_ops.rs:28:5
|
28 | a = 1 + a;
| ^^^^^^^^^ help: replace it with `a += 1`
| ^^^^^^^^^ help: replace it with: `a += 1`

error: manual implementation of an assign operation
--> assign_ops.rs:29:5
|
29 | a = a - 1;
| ^^^^^^^^^ help: replace it with `a -= 1`
| ^^^^^^^^^ help: replace it with: `a -= 1`

error: manual implementation of an assign operation
--> assign_ops.rs:30:5
|
30 | a = a * 99;
| ^^^^^^^^^^ help: replace it with `a *= 99`
| ^^^^^^^^^^ help: replace it with: `a *= 99`

error: manual implementation of an assign operation
--> assign_ops.rs:31:5
|
31 | a = 42 * a;
| ^^^^^^^^^^ help: replace it with `a *= 42`
| ^^^^^^^^^^ help: replace it with: `a *= 42`

error: manual implementation of an assign operation
--> assign_ops.rs:32:5
|
32 | a = a / 2;
| ^^^^^^^^^ help: replace it with `a /= 2`
| ^^^^^^^^^ help: replace it with: `a /= 2`

error: manual implementation of an assign operation
--> assign_ops.rs:33:5
|
33 | a = a % 5;
| ^^^^^^^^^ help: replace it with `a %= 5`
| ^^^^^^^^^ help: replace it with: `a %= 5`

error: manual implementation of an assign operation
--> assign_ops.rs:34:5
|
34 | a = a & 1;
| ^^^^^^^^^ help: replace it with `a &= 1`
| ^^^^^^^^^ help: replace it with: `a &= 1`

error: manual implementation of an assign operation
--> assign_ops.rs:40:5
|
40 | s = s + "bla";
| ^^^^^^^^^^^^^ help: replace it with `s += "bla"`
| ^^^^^^^^^^^^^ help: replace it with: `s += "bla"`

error: aborting due to 22 previous errors

Expand Down
16 changes: 8 additions & 8 deletions clippy_tests/examples/assign_ops2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@ error: variable appears on both sides of an assignment operation
--> assign_ops2.rs:8:5
|
8 | a += a + 1;
| ^^^^^^^^^^ help: replace it with `a += 1`
| ^^^^^^^^^^ help: replace it with: `a += 1`
|
= note: `-D misrefactored-assign-op` implied by `-D warnings`

error: variable appears on both sides of an assignment operation
--> assign_ops2.rs:9:5
|
9 | a += 1 + a;
| ^^^^^^^^^^ help: replace it with `a += 1`
| ^^^^^^^^^^ help: replace it with: `a += 1`

error: variable appears on both sides of an assignment operation
--> assign_ops2.rs:10:5
|
10 | a -= a - 1;
| ^^^^^^^^^^ help: replace it with `a -= 1`
| ^^^^^^^^^^ help: replace it with: `a -= 1`

error: variable appears on both sides of an assignment operation
--> assign_ops2.rs:11:5
|
11 | a *= a * 99;
| ^^^^^^^^^^^ help: replace it with `a *= 99`
| ^^^^^^^^^^^ help: replace it with: `a *= 99`

error: variable appears on both sides of an assignment operation
--> assign_ops2.rs:12:5
|
12 | a *= 42 * a;
| ^^^^^^^^^^^ help: replace it with `a *= 42`
| ^^^^^^^^^^^ help: replace it with: `a *= 42`

error: variable appears on both sides of an assignment operation
--> assign_ops2.rs:13:5
|
13 | a /= a / 2;
| ^^^^^^^^^^ help: replace it with `a /= 2`
| ^^^^^^^^^^ help: replace it with: `a /= 2`

error: variable appears on both sides of an assignment operation
--> assign_ops2.rs:14:5
|
14 | a %= a % 5;
| ^^^^^^^^^^ help: replace it with `a %= 5`
| ^^^^^^^^^^ help: replace it with: `a %= 5`

error: variable appears on both sides of an assignment operation
--> assign_ops2.rs:15:5
|
15 | a &= a & 1;
| ^^^^^^^^^^ help: replace it with `a &= 1`
| ^^^^^^^^^^ help: replace it with: `a &= 1`

error: aborting due to 8 previous errors

Expand Down
2 changes: 1 addition & 1 deletion clippy_tests/examples/block_in_if_condition.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ error: this boolean expression can be simplified
--> block_in_if_condition.rs:67:8
|
67 | if true && x == 3 {
| ^^^^^^^^^^^^^^ help: try `x == 3`
| ^^^^^^^^^^^^^^ help: try: `x == 3`
|
= note: `-D nonminimal-bool` implied by `-D warnings`

Expand Down
8 changes: 4 additions & 4 deletions clippy_tests/examples/bool_comparison.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ error: equality checks against true are unnecessary
--> bool_comparison.rs:7:8
|
7 | if x == true { "yes" } else { "no" };
| ^^^^^^^^^ help: try simplifying it as shown: `x`
| ^^^^^^^^^ help: try simplifying it as shown:: `x`
|
= note: `-D bool-comparison` implied by `-D warnings`

error: equality checks against false can be replaced by a negation
--> bool_comparison.rs:8:8
|
8 | if x == false { "yes" } else { "no" };
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
| ^^^^^^^^^^ help: try simplifying it as shown:: `!x`

error: equality checks against true are unnecessary
--> bool_comparison.rs:9:8
|
9 | if true == x { "yes" } else { "no" };
| ^^^^^^^^^ help: try simplifying it as shown: `x`
| ^^^^^^^^^ help: try simplifying it as shown:: `x`

error: equality checks against false can be replaced by a negation
--> bool_comparison.rs:10:8
|
10 | if false == x { "yes" } else { "no" };
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
| ^^^^^^^^^^ help: try simplifying it as shown:: `!x`

error: aborting due to 4 previous errors

Expand Down
34 changes: 23 additions & 11 deletions clippy_tests/examples/booleans.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error: this boolean expression contains a logic bug
--> booleans.rs:12:13
|
12 | let _ = a && b || a;
| ^^^^^^^^^^^ help: it would look like the following `a`
| ^^^^^^^^^^^ help: it would look like the following: `a`
|
= note: `-D logic-bug` implied by `-D warnings`
help: this expression can be optimized out by applying boolean operations to the outer expression
Expand All @@ -15,27 +15,27 @@ error: this boolean expression can be simplified
--> booleans.rs:14:13
|
14 | let _ = !true;
| ^^^^^ help: try `false`
| ^^^^^ help: try: `false`
|
= note: `-D nonminimal-bool` implied by `-D warnings`

error: this boolean expression can be simplified
--> booleans.rs:15:13
|
15 | let _ = !false;
| ^^^^^^ help: try `true`
| ^^^^^^ help: try: `true`

error: this boolean expression can be simplified
--> booleans.rs:16:13
|
16 | let _ = !!a;
| ^^^ help: try `a`
| ^^^ help: try: `a`

error: this boolean expression contains a logic bug
--> booleans.rs:17:13
|
17 | let _ = false && a;
| ^^^^^^^^^^ help: it would look like the following `false`
| ^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
--> booleans.rs:17:22
Expand All @@ -47,19 +47,31 @@ error: this boolean expression can be simplified
--> booleans.rs:18:13
|
18 | let _ = false || a;
| ^^^^^^^^^^ help: try `a`
| ^^^^^^^^^^ help: try: `a`

error: this boolean expression contains a logic bug
--> booleans.rs:20:13
|
20 | let _ = cfg!(you_shall_not_not_pass) && a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
--> booleans.rs:20:45
|
20 | let _ = cfg!(you_shall_not_not_pass) && a;
| ^

error: this boolean expression can be simplified
--> booleans.rs:23:13
|
23 | let _ = !(!a && b);
| ^^^^^^^^^^ help: try `!b || a`
| ^^^^^^^^^^ help: try: `!b || a`

error: this boolean expression contains a logic bug
--> booleans.rs:33:13
|
33 | let _ = a == b && a != b;
| ^^^^^^^^^^^^^^^^ help: it would look like the following `false`
| ^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
--> booleans.rs:33:13
Expand Down Expand Up @@ -97,7 +109,7 @@ error: this boolean expression contains a logic bug
--> booleans.rs:36:13
|
36 | let _ = a < b && a >= b;
| ^^^^^^^^^^^^^^^ help: it would look like the following `false`
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
--> booleans.rs:36:13
Expand All @@ -109,7 +121,7 @@ error: this boolean expression contains a logic bug
--> booleans.rs:37:13
|
37 | let _ = a > b && a <= b;
| ^^^^^^^^^^^^^^^ help: it would look like the following `false`
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
--> booleans.rs:37:13
Expand All @@ -130,7 +142,7 @@ help: try
39 | let _ = !(a == b && c == d);
| ^^^^^^^^^^^^^^^^^^^

error: aborting due to 13 previous errors
error: aborting due to 14 previous errors


To learn more, run the command again with --verbose.
8 changes: 4 additions & 4 deletions clippy_tests/examples/borrow_box.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> borrow_box.rs:9:19
|
9 | pub fn test1(foo: &mut Box<bool>) {
| ^^^^^^^^^^^^^^ help: try `&mut bool`
| ^^^^^^^^^^^^^^ help: try: `&mut bool`
|
note: lint level defined here
--> borrow_box.rs:4:9
Expand All @@ -14,19 +14,19 @@ error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> borrow_box.rs:14:14
|
14 | let foo: &Box<bool>;
| ^^^^^^^^^^ help: try `&bool`
| ^^^^^^^^^^ help: try: `&bool`

error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> borrow_box.rs:18:10
|
18 | foo: &'a Box<bool>
| ^^^^^^^^^^^^^ help: try `&'a bool`
| ^^^^^^^^^^^^^ help: try: `&'a bool`

error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> borrow_box.rs:22:17
|
22 | fn test4(a: &Box<bool>);
| ^^^^^^^^^^ help: try `&bool`
| ^^^^^^^^^^ help: try: `&bool`

error: aborting due to 4 previous errors

Expand Down
Loading