Update *.stderr files

This commit is contained in:
flip1995 2018-12-27 16:57:55 +01:00
parent 9fddb2afce
commit d2dbd0b8a5
No known key found for this signature in database
GPG Key ID: E8E897A5870E41C2
223 changed files with 4700 additions and 4700 deletions

View File

@ -1,7 +1,7 @@
error: use of a blacklisted/placeholder name `toto`
--> $DIR/conf_french_blacklisted_name.rs:15:9
|
15 | fn test(toto: ()) {}
LL | fn test(toto: ()) {}
| ^^^^
|
= note: `-D clippy::blacklisted-name` implied by `-D warnings`
@ -9,37 +9,37 @@ error: use of a blacklisted/placeholder name `toto`
error: use of a blacklisted/placeholder name `toto`
--> $DIR/conf_french_blacklisted_name.rs:18:9
|
18 | let toto = 42;
LL | let toto = 42;
| ^^^^
error: use of a blacklisted/placeholder name `tata`
--> $DIR/conf_french_blacklisted_name.rs:19:9
|
19 | let tata = 42;
LL | let tata = 42;
| ^^^^
error: use of a blacklisted/placeholder name `titi`
--> $DIR/conf_french_blacklisted_name.rs:20:9
|
20 | let titi = 42;
LL | let titi = 42;
| ^^^^
error: use of a blacklisted/placeholder name `toto`
--> $DIR/conf_french_blacklisted_name.rs:26:10
|
26 | (toto, Some(tata), titi @ Some(_)) => (),
LL | (toto, Some(tata), titi @ Some(_)) => (),
| ^^^^
error: use of a blacklisted/placeholder name `tata`
--> $DIR/conf_french_blacklisted_name.rs:26:21
|
26 | (toto, Some(tata), titi @ Some(_)) => (),
LL | (toto, Some(tata), titi @ Some(_)) => (),
| ^^^^
error: use of a blacklisted/placeholder name `titi`
--> $DIR/conf_french_blacklisted_name.rs:26:28
|
26 | (toto, Some(tata), titi @ Some(_)) => (),
LL | (toto, Some(tata), titi @ Some(_)) => (),
| ^^^^
error: aborting due to 7 previous errors

View File

@ -1,7 +1,7 @@
error: this argument is passed by reference, but would be more efficient if passed by value
--> $DIR/test.rs:20:11
|
20 | fn bad(x: &u16, y: &Foo) {}
LL | fn bad(x: &u16, y: &Foo) {}
| ^^^^ help: consider passing by value instead: `u16`
|
= note: `-D clippy::trivially-copy-pass-by-ref` implied by `-D warnings`
@ -9,7 +9,7 @@ error: this argument is passed by reference, but would be more efficient if pass
error: this argument is passed by reference, but would be more efficient if passed by value
--> $DIR/test.rs:20:20
|
20 | fn bad(x: &u16, y: &Foo) {}
LL | fn bad(x: &u16, y: &Foo) {}
| ^^^^ help: consider passing by value instead: `Foo`
error: aborting due to 2 previous errors

View File

@ -1,7 +1,7 @@
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:23:5
|
23 | u <= 0;
LL | u <= 0;
| ^^^^^^
|
= note: `-D clippy::absurd-extreme-comparisons` implied by `-D warnings`
@ -10,7 +10,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:24:5
|
24 | u <= Z;
LL | u <= Z;
| ^^^^^^
|
= help: because Z is the minimum value for this type, the case where the two sides are not equal never occurs, consider using u == Z instead
@ -18,7 +18,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:25:5
|
25 | u < Z;
LL | u < Z;
| ^^^^^
|
= help: because Z is the minimum value for this type, this comparison is always false
@ -26,7 +26,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:26:5
|
26 | Z >= u;
LL | Z >= u;
| ^^^^^^
|
= help: because Z is the minimum value for this type, the case where the two sides are not equal never occurs, consider using Z == u instead
@ -34,7 +34,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:27:5
|
27 | Z > u;
LL | Z > u;
| ^^^^^
|
= help: because Z is the minimum value for this type, this comparison is always false
@ -42,7 +42,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:28:5
|
28 | u > std::u32::MAX;
LL | u > std::u32::MAX;
| ^^^^^^^^^^^^^^^^^
|
= help: because std::u32::MAX is the maximum value for this type, this comparison is always false
@ -50,7 +50,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:29:5
|
29 | u >= std::u32::MAX;
LL | u >= std::u32::MAX;
| ^^^^^^^^^^^^^^^^^^
|
= help: because std::u32::MAX is the maximum value for this type, the case where the two sides are not equal never occurs, consider using u == std::u32::MAX instead
@ -58,7 +58,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:30:5
|
30 | std::u32::MAX < u;
LL | std::u32::MAX < u;
| ^^^^^^^^^^^^^^^^^
|
= help: because std::u32::MAX is the maximum value for this type, this comparison is always false
@ -66,7 +66,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:31:5
|
31 | std::u32::MAX <= u;
LL | std::u32::MAX <= u;
| ^^^^^^^^^^^^^^^^^^
|
= help: because std::u32::MAX is the maximum value for this type, the case where the two sides are not equal never occurs, consider using std::u32::MAX == u instead
@ -74,7 +74,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:32:5
|
32 | 1-1 > u;
LL | 1-1 > u;
| ^^^^^^^
|
= help: because 1-1 is the minimum value for this type, this comparison is always false
@ -82,7 +82,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:33:5
|
33 | u >= !0;
LL | u >= !0;
| ^^^^^^^
|
= help: because !0 is the maximum value for this type, the case where the two sides are not equal never occurs, consider using u == !0 instead
@ -90,7 +90,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:34:5
|
34 | u <= 12 - 2*6;
LL | u <= 12 - 2*6;
| ^^^^^^^^^^^^^
|
= help: because 12 - 2*6 is the minimum value for this type, the case where the two sides are not equal never occurs, consider using u == 12 - 2*6 instead
@ -98,7 +98,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:36:5
|
36 | i < -127 - 1;
LL | i < -127 - 1;
| ^^^^^^^^^^^^
|
= help: because -127 - 1 is the minimum value for this type, this comparison is always false
@ -106,7 +106,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:37:5
|
37 | std::i8::MAX >= i;
LL | std::i8::MAX >= i;
| ^^^^^^^^^^^^^^^^^
|
= help: because std::i8::MAX is the maximum value for this type, this comparison is always true
@ -114,7 +114,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:38:5
|
38 | 3-7 < std::i32::MIN;
LL | 3-7 < std::i32::MIN;
| ^^^^^^^^^^^^^^^^^^^
|
= help: because std::i32::MIN is the minimum value for this type, this comparison is always false
@ -122,7 +122,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:40:5
|
40 | b >= true;
LL | b >= true;
| ^^^^^^^^^
|
= help: because true is the maximum value for this type, the case where the two sides are not equal never occurs, consider using b == true instead
@ -130,7 +130,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:41:5
|
41 | false > b;
LL | false > b;
| ^^^^^^^^^
|
= help: because false is the minimum value for this type, this comparison is always false
@ -138,7 +138,7 @@ error: this comparison involving the minimum or maximum element for this type co
error: <-comparison of unit values detected. This will always be false
--> $DIR/absurd-extreme-comparisons.rs:44:5
|
44 | () < {};
LL | () < {};
| ^^^^^^^
|
= note: #[deny(clippy::unit_cmp)] on by default

View File

@ -1,7 +1,7 @@
error: approximate value of `f{32, 64}::consts::E` found. Consider using it directly
--> $DIR/approx_const.rs:13:16
|
13 | let my_e = 2.7182;
LL | let my_e = 2.7182;
| ^^^^^^
|
= note: `-D clippy::approx-constant` implied by `-D warnings`
@ -9,109 +9,109 @@ error: approximate value of `f{32, 64}::consts::E` found. Consider using it dire
error: approximate value of `f{32, 64}::consts::E` found. Consider using it directly
--> $DIR/approx_const.rs:14:20
|
14 | let almost_e = 2.718;
LL | let almost_e = 2.718;
| ^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_1_PI` found. Consider using it directly
--> $DIR/approx_const.rs:17:24
|
17 | let my_1_frac_pi = 0.3183;
LL | let my_1_frac_pi = 0.3183;
| ^^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found. Consider using it directly
--> $DIR/approx_const.rs:20:28
|
20 | let my_frac_1_sqrt_2 = 0.70710678;
LL | let my_frac_1_sqrt_2 = 0.70710678;
| ^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found. Consider using it directly
--> $DIR/approx_const.rs:21:32
|
21 | let almost_frac_1_sqrt_2 = 0.70711;
LL | let almost_frac_1_sqrt_2 = 0.70711;
| ^^^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_2_PI` found. Consider using it directly
--> $DIR/approx_const.rs:24:24
|
24 | let my_frac_2_pi = 0.63661977;
LL | let my_frac_2_pi = 0.63661977;
| ^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_2_SQRT_PI` found. Consider using it directly
--> $DIR/approx_const.rs:27:27
|
27 | let my_frac_2_sq_pi = 1.128379;
LL | let my_frac_2_sq_pi = 1.128379;
| ^^^^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_PI_2` found. Consider using it directly
--> $DIR/approx_const.rs:30:24
|
30 | let my_frac_pi_2 = 1.57079632679;
LL | let my_frac_pi_2 = 1.57079632679;
| ^^^^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_PI_3` found. Consider using it directly
--> $DIR/approx_const.rs:33:24
|
33 | let my_frac_pi_3 = 1.04719755119;
LL | let my_frac_pi_3 = 1.04719755119;
| ^^^^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_PI_4` found. Consider using it directly
--> $DIR/approx_const.rs:36:24
|
36 | let my_frac_pi_4 = 0.785398163397;
LL | let my_frac_pi_4 = 0.785398163397;
| ^^^^^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_PI_6` found. Consider using it directly
--> $DIR/approx_const.rs:39:24
|
39 | let my_frac_pi_6 = 0.523598775598;
LL | let my_frac_pi_6 = 0.523598775598;
| ^^^^^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::FRAC_PI_8` found. Consider using it directly
--> $DIR/approx_const.rs:42:24
|
42 | let my_frac_pi_8 = 0.3926990816987;
LL | let my_frac_pi_8 = 0.3926990816987;
| ^^^^^^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::LN_10` found. Consider using it directly
--> $DIR/approx_const.rs:45:20
|
45 | let my_ln_10 = 2.302585092994046;
LL | let my_ln_10 = 2.302585092994046;
| ^^^^^^^^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::LN_2` found. Consider using it directly
--> $DIR/approx_const.rs:48:19
|
48 | let my_ln_2 = 0.6931471805599453;
LL | let my_ln_2 = 0.6931471805599453;
| ^^^^^^^^^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::LOG10_E` found. Consider using it directly
--> $DIR/approx_const.rs:51:22
|
51 | let my_log10_e = 0.4342944819032518;
LL | let my_log10_e = 0.4342944819032518;
| ^^^^^^^^^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::LOG2_E` found. Consider using it directly
--> $DIR/approx_const.rs:54:21
|
54 | let my_log2_e = 1.4426950408889634;
LL | let my_log2_e = 1.4426950408889634;
| ^^^^^^^^^^^^^^^^^^
error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly
--> $DIR/approx_const.rs:57:17
|
57 | let my_pi = 3.1415;
LL | let my_pi = 3.1415;
| ^^^^^^
error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly
--> $DIR/approx_const.rs:58:21
|
58 | let almost_pi = 3.14;
LL | let almost_pi = 3.14;
| ^^^^
error: approximate value of `f{32, 64}::consts::SQRT_2` found. Consider using it directly
--> $DIR/approx_const.rs:61:18
|
61 | let my_sq2 = 1.4142;
LL | let my_sq2 = 1.4142;
| ^^^^^^
error: aborting due to 19 previous errors

View File

@ -1,7 +1,7 @@
error: integer arithmetic detected
--> $DIR/arithmetic.rs:22:5
|
22 | 1 + i;
LL | 1 + i;
| ^^^^^
|
= note: `-D clippy::integer-arithmetic` implied by `-D warnings`
@ -9,32 +9,32 @@ error: integer arithmetic detected
error: integer arithmetic detected
--> $DIR/arithmetic.rs:23:5
|
23 | i * 2;
LL | i * 2;
| ^^^^^
error: integer arithmetic detected
--> $DIR/arithmetic.rs:24:5
|
24 | / 1 %
25 | | i / 2; // no error, this is part of the expression in the preceding line
LL | / 1 %
LL | | i / 2; // no error, this is part of the expression in the preceding line
| |_________^
error: integer arithmetic detected
--> $DIR/arithmetic.rs:26:5
|
26 | i - 2 + 2 - i;
LL | i - 2 + 2 - i;
| ^^^^^^^^^^^^^
error: integer arithmetic detected
--> $DIR/arithmetic.rs:27:5
|
27 | -i;
LL | -i;
| ^^
error: floating-point arithmetic detected
--> $DIR/arithmetic.rs:37:5
|
37 | f * 2.0;
LL | f * 2.0;
| ^^^^^^^
|
= note: `-D clippy::float-arithmetic` implied by `-D warnings`
@ -42,31 +42,31 @@ error: floating-point arithmetic detected
error: floating-point arithmetic detected
--> $DIR/arithmetic.rs:39:5
|
39 | 1.0 + f;
LL | 1.0 + f;
| ^^^^^^^
error: floating-point arithmetic detected
--> $DIR/arithmetic.rs:40:5
|
40 | f * 2.0;
LL | f * 2.0;
| ^^^^^^^
error: floating-point arithmetic detected
--> $DIR/arithmetic.rs:41:5
|
41 | f / 2.0;
LL | f / 2.0;
| ^^^^^^^
error: floating-point arithmetic detected
--> $DIR/arithmetic.rs:42:5
|
42 | f - 2.0 * 4.2;
LL | f - 2.0 * 4.2;
| ^^^^^^^^^^^^^
error: floating-point arithmetic detected
--> $DIR/arithmetic.rs:43:5
|
43 | -f;
LL | -f;
| ^^
error: aborting due to 11 previous errors

View File

@ -1,7 +1,7 @@
error: manual implementation of an assign operation
--> $DIR/assign_ops.rs:14:5
|
14 | a = a + 1;
LL | a = a + 1;
| ^^^^^^^^^ help: replace it with: `a += 1`
|
= note: `-D clippy::assign-op-pattern` implied by `-D warnings`
@ -9,49 +9,49 @@ error: manual implementation of an assign operation
error: manual implementation of an assign operation
--> $DIR/assign_ops.rs:15:5
|
15 | a = 1 + a;
LL | a = 1 + a;
| ^^^^^^^^^ help: replace it with: `a += 1`
error: manual implementation of an assign operation
--> $DIR/assign_ops.rs:16:5
|
16 | a = a - 1;
LL | a = a - 1;
| ^^^^^^^^^ help: replace it with: `a -= 1`
error: manual implementation of an assign operation
--> $DIR/assign_ops.rs:17:5
|
17 | a = a * 99;
LL | a = a * 99;
| ^^^^^^^^^^ help: replace it with: `a *= 99`
error: manual implementation of an assign operation
--> $DIR/assign_ops.rs:18:5
|
18 | a = 42 * a;
LL | a = 42 * a;
| ^^^^^^^^^^ help: replace it with: `a *= 42`
error: manual implementation of an assign operation
--> $DIR/assign_ops.rs:19:5
|
19 | a = a / 2;
LL | a = a / 2;
| ^^^^^^^^^ help: replace it with: `a /= 2`
error: manual implementation of an assign operation
--> $DIR/assign_ops.rs:20:5
|
20 | a = a % 5;
LL | a = a % 5;
| ^^^^^^^^^ help: replace it with: `a %= 5`
error: manual implementation of an assign operation
--> $DIR/assign_ops.rs:21:5
|
21 | a = a & 1;
LL | a = a & 1;
| ^^^^^^^^^ help: replace it with: `a &= 1`
error: manual implementation of an assign operation
--> $DIR/assign_ops.rs:27:5
|
27 | s = s + "bla";
LL | s = s + "bla";
| ^^^^^^^^^^^^^ help: replace it with: `s += "bla"`
error: aborting due to 9 previous errors

View File

@ -1,135 +1,135 @@
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:14:5
|
14 | a += a + 1;
LL | a += a + 1;
| ^^^^^^^^^^
|
= note: `-D clippy::misrefactored-assign-op` implied by `-D warnings`
help: Did you mean a = a + 1 or a = a + a + 1? Consider replacing it with
|
14 | a += 1;
LL | a += 1;
| ^^^^^^
help: or
|
14 | a = a + a + 1;
LL | a = a + a + 1;
| ^^^^^^^^^^^^^
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:15:5
|
15 | a += 1 + a;
LL | a += 1 + a;
| ^^^^^^^^^^
help: Did you mean a = a + 1 or a = a + 1 + a? Consider replacing it with
|
15 | a += 1;
LL | a += 1;
| ^^^^^^
help: or
|
15 | a = a + 1 + a;
LL | a = a + 1 + a;
| ^^^^^^^^^^^^^
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:16:5
|
16 | a -= a - 1;
LL | a -= a - 1;
| ^^^^^^^^^^
help: Did you mean a = a - 1 or a = a - (a - 1)? Consider replacing it with
|
16 | a -= 1;
LL | a -= 1;
| ^^^^^^
help: or
|
16 | a = a - (a - 1);
LL | a = a - (a - 1);
| ^^^^^^^^^^^^^^^
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:17:5
|
17 | a *= a * 99;
LL | a *= a * 99;
| ^^^^^^^^^^^
help: Did you mean a = a * 99 or a = a * a * 99? Consider replacing it with
|
17 | a *= 99;
LL | a *= 99;
| ^^^^^^^
help: or
|
17 | a = a * a * 99;
LL | a = a * a * 99;
| ^^^^^^^^^^^^^^
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:18:5
|
18 | a *= 42 * a;
LL | a *= 42 * a;
| ^^^^^^^^^^^
help: Did you mean a = a * 42 or a = a * 42 * a? Consider replacing it with
|
18 | a *= 42;
LL | a *= 42;
| ^^^^^^^
help: or
|
18 | a = a * 42 * a;
LL | a = a * 42 * a;
| ^^^^^^^^^^^^^^
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:19:5
|
19 | a /= a / 2;
LL | a /= a / 2;
| ^^^^^^^^^^
help: Did you mean a = a / 2 or a = a / (a / 2)? Consider replacing it with
|
19 | a /= 2;
LL | a /= 2;
| ^^^^^^
help: or
|
19 | a = a / (a / 2);
LL | a = a / (a / 2);
| ^^^^^^^^^^^^^^^
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:20:5
|
20 | a %= a % 5;
LL | a %= a % 5;
| ^^^^^^^^^^
help: Did you mean a = a % 5 or a = a % (a % 5)? Consider replacing it with
|
20 | a %= 5;
LL | a %= 5;
| ^^^^^^
help: or
|
20 | a = a % (a % 5);
LL | a = a % (a % 5);
| ^^^^^^^^^^^^^^^
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:21:5
|
21 | a &= a & 1;
LL | a &= a & 1;
| ^^^^^^^^^^
help: Did you mean a = a & 1 or a = a & a & 1? Consider replacing it with
|
21 | a &= 1;
LL | a &= 1;
| ^^^^^^
help: or
|
21 | a = a & a & 1;
LL | a = a & a & 1;
| ^^^^^^^^^^^^^
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:22:5
|
22 | a *= a * a;
LL | a *= a * a;
| ^^^^^^^^^^
help: Did you mean a = a * a or a = a * a * a? Consider replacing it with
|
22 | a *= a;
LL | a *= a;
| ^^^^^^
help: or
|
22 | a = a * a * a;
LL | a = a * a * a;
| ^^^^^^^^^^^^^
error: manual implementation of an assign operation
--> $DIR/assign_ops2.rs:59:5
|
59 | buf = buf + cows.clone();
LL | buf = buf + cows.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `buf += cows.clone()`
|
= note: `-D clippy::assign-op-pattern` implied by `-D warnings`

View File

@ -1,7 +1,7 @@
error: you have declared `#[inline(always)]` on `test_attr_lint`. This is usually a bad idea
--> $DIR/attrs.rs:12:1
|
12 | #[inline(always)]
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::inline-always` implied by `-D warnings`
@ -9,7 +9,7 @@ error: you have declared `#[inline(always)]` on `test_attr_lint`. This is usuall
error: the since field must contain a semver-compliant version
--> $DIR/attrs.rs:32:14
|
32 | #[deprecated(since = "forever")]
LL | #[deprecated(since = "forever")]
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::deprecated-semver` implied by `-D warnings`
@ -17,7 +17,7 @@ error: the since field must contain a semver-compliant version
error: the since field must contain a semver-compliant version
--> $DIR/attrs.rs:35:14
|
35 | #[deprecated(since = "1")]
LL | #[deprecated(since = "1")]
| ^^^^^^^^^^^
error: aborting due to 3 previous errors

View File

@ -1,14 +1,14 @@
error: returning the result of a let binding from a block. Consider returning the expression directly.
--> $DIR/matches.rs:18:13
|
18 | x
LL | x
| ^
|
= note: `-D clippy::let-and-return` implied by `-D warnings`
note: this expression can be directly returned
--> $DIR/matches.rs:17:21
|
17 | let x = 3;
LL | let x = 3;
| ^
error: aborting due to previous error

View File

@ -1,7 +1,7 @@
error: &-masking with zero
--> $DIR/bit_masks.rs:23:5
|
23 | x & 0 == 0;
LL | x & 0 == 0;
| ^^^^^^^^^^
|
= note: `-D clippy::bad-bit-mask` implied by `-D warnings`
@ -9,7 +9,7 @@ error: &-masking with zero
error: this operation will always return zero. This is likely not the intended outcome
--> $DIR/bit_masks.rs:23:5
|
23 | x & 0 == 0;
LL | x & 0 == 0;
| ^^^^^
|
= note: #[deny(clippy::erasing_op)] on by default
@ -17,73 +17,73 @@ error: this operation will always return zero. This is likely not the intended o
error: incompatible bit mask: `_ & 2` can never be equal to `1`
--> $DIR/bit_masks.rs:26:5
|
26 | x & 2 == 1;
LL | x & 2 == 1;
| ^^^^^^^^^^
error: incompatible bit mask: `_ | 3` can never be equal to `2`
--> $DIR/bit_masks.rs:30:5
|
30 | x | 3 == 2;
LL | x | 3 == 2;
| ^^^^^^^^^^
error: incompatible bit mask: `_ & 1` will never be higher than `1`
--> $DIR/bit_masks.rs:32:5
|
32 | x & 1 > 1;
LL | x & 1 > 1;
| ^^^^^^^^^
error: incompatible bit mask: `_ | 2` will always be higher than `1`
--> $DIR/bit_masks.rs:36:5
|
36 | x | 2 > 1;
LL | x | 2 > 1;
| ^^^^^^^^^
error: incompatible bit mask: `_ & 7` can never be equal to `8`
--> $DIR/bit_masks.rs:43:5
|
43 | x & THREE_BITS == 8;
LL | x & THREE_BITS == 8;
| ^^^^^^^^^^^^^^^^^^^
error: incompatible bit mask: `_ | 7` will never be lower than `7`
--> $DIR/bit_masks.rs:44:5
|
44 | x | EVEN_MORE_REDIRECTION < 7;
LL | x | EVEN_MORE_REDIRECTION < 7;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: &-masking with zero
--> $DIR/bit_masks.rs:46:5
|
46 | 0 & x == 0;
LL | 0 & x == 0;
| ^^^^^^^^^^
error: this operation will always return zero. This is likely not the intended outcome
--> $DIR/bit_masks.rs:46:5
|
46 | 0 & x == 0;
LL | 0 & x == 0;
| ^^^^^
error: incompatible bit mask: `_ | 2` will always be higher than `1`
--> $DIR/bit_masks.rs:50:5
|
50 | 1 < 2 | x;
LL | 1 < 2 | x;
| ^^^^^^^^^
error: incompatible bit mask: `_ | 3` can never be equal to `2`
--> $DIR/bit_masks.rs:51:5
|
51 | 2 == 3 | x;
LL | 2 == 3 | x;
| ^^^^^^^^^^
error: incompatible bit mask: `_ & 2` can never be equal to `1`
--> $DIR/bit_masks.rs:52:5
|
52 | 1 == x & 2;
LL | 1 == x & 2;
| ^^^^^^^^^^
error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly
--> $DIR/bit_masks.rs:63:5
|
63 | x | 1 > 3;
LL | x | 1 > 3;
| ^^^^^^^^^
|
= note: `-D clippy::ineffective-bit-mask` implied by `-D warnings`
@ -91,19 +91,19 @@ error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared
error: ineffective bit mask: `x | 1` compared to `4`, is the same as x compared directly
--> $DIR/bit_masks.rs:64:5
|
64 | x | 1 < 4;
LL | x | 1 < 4;
| ^^^^^^^^^
error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly
--> $DIR/bit_masks.rs:65:5
|
65 | x | 1 <= 3;
LL | x | 1 <= 3;
| ^^^^^^^^^^
error: ineffective bit mask: `x | 1` compared to `8`, is the same as x compared directly
--> $DIR/bit_masks.rs:66:5
|
66 | x | 1 >= 8;
LL | x | 1 >= 8;
| ^^^^^^^^^^
error: aborting due to 17 previous errors

View File

@ -1,7 +1,7 @@
error: use of a blacklisted/placeholder name `foo`
--> $DIR/blacklisted_name.rs:20:9
|
20 | fn test(foo: ()) {}
LL | fn test(foo: ()) {}
| ^^^
|
= note: `-D clippy::blacklisted-name` implied by `-D warnings`
@ -9,79 +9,79 @@ error: use of a blacklisted/placeholder name `foo`
error: use of a blacklisted/placeholder name `foo`
--> $DIR/blacklisted_name.rs:23:9
|
23 | let foo = 42;
LL | let foo = 42;
| ^^^
error: use of a blacklisted/placeholder name `bar`
--> $DIR/blacklisted_name.rs:24:9
|
24 | let bar = 42;
LL | let bar = 42;
| ^^^
error: use of a blacklisted/placeholder name `baz`
--> $DIR/blacklisted_name.rs:25:9
|
25 | let baz = 42;
LL | let baz = 42;
| ^^^
error: use of a blacklisted/placeholder name `foo`
--> $DIR/blacklisted_name.rs:31:10
|
31 | (foo, Some(bar), baz @ Some(_)) => (),
LL | (foo, Some(bar), baz @ Some(_)) => (),
| ^^^
error: use of a blacklisted/placeholder name `bar`
--> $DIR/blacklisted_name.rs:31:20
|
31 | (foo, Some(bar), baz @ Some(_)) => (),
LL | (foo, Some(bar), baz @ Some(_)) => (),
| ^^^
error: use of a blacklisted/placeholder name `baz`
--> $DIR/blacklisted_name.rs:31:26
|
31 | (foo, Some(bar), baz @ Some(_)) => (),
LL | (foo, Some(bar), baz @ Some(_)) => (),
| ^^^
error: use of a blacklisted/placeholder name `foo`
--> $DIR/blacklisted_name.rs:36:19
|
36 | fn issue_1647(mut foo: u8) {
LL | fn issue_1647(mut foo: u8) {
| ^^^
error: use of a blacklisted/placeholder name `bar`
--> $DIR/blacklisted_name.rs:37:13
|
37 | let mut bar = 0;
LL | let mut bar = 0;
| ^^^
error: use of a blacklisted/placeholder name `baz`
--> $DIR/blacklisted_name.rs:38:21
|
38 | if let Some(mut baz) = Some(42) {}
LL | if let Some(mut baz) = Some(42) {}
| ^^^
error: use of a blacklisted/placeholder name `bar`
--> $DIR/blacklisted_name.rs:42:13
|
42 | let ref bar = 0;
LL | let ref bar = 0;
| ^^^
error: use of a blacklisted/placeholder name `baz`
--> $DIR/blacklisted_name.rs:43:21
|
43 | if let Some(ref baz) = Some(42) {}
LL | if let Some(ref baz) = Some(42) {}
| ^^^
error: use of a blacklisted/placeholder name `bar`
--> $DIR/blacklisted_name.rs:47:17
|
47 | let ref mut bar = 0;
LL | let ref mut bar = 0;
| ^^^
error: use of a blacklisted/placeholder name `baz`
--> $DIR/blacklisted_name.rs:48:25
|
48 | if let Some(ref mut baz) = Some(42) {}
LL | if let Some(ref mut baz) = Some(42) {}
| ^^^
error: aborting due to 14 previous errors

View File

@ -1,11 +1,11 @@
error: in an 'if' condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a 'let'
--> $DIR/block_in_if_condition.rs:35:8
|
35 | if {
LL | if {
| ________^
36 | | let x = 3;
37 | | x == 3
38 | | } {
LL | | let x = 3;
LL | | x == 3
LL | | } {
| |_____^
|
= note: `-D clippy::block-in-if-condition-stmt` implied by `-D warnings`
@ -21,7 +21,7 @@ error: in an 'if' condition, avoid complex blocks or closures with blocks; inste
error: omit braces around single expression condition
--> $DIR/block_in_if_condition.rs:46:8
|
46 | if { true } {
LL | if { true } {
| ^^^^^^^^
|
= note: `-D clippy::block-in-if-condition-expr` implied by `-D warnings`
@ -33,27 +33,27 @@ error: omit braces around single expression condition
error: in an 'if' condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a 'let'
--> $DIR/block_in_if_condition.rs:66:17
|
66 | |x| {
LL | |x| {
| _________________^
67 | | let target = 3;
68 | | x == target
69 | | },
LL | | let target = 3;
LL | | x == target
LL | | },
| |_____________^
error: in an 'if' condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a 'let'
--> $DIR/block_in_if_condition.rs:75:13
|
75 | |x| {
LL | |x| {
| _____________^
76 | | let target = 3;
77 | | x == target
78 | | },
LL | | let target = 3;
LL | | x == target
LL | | },
| |_________^
error: this boolean expression can be simplified
--> $DIR/block_in_if_condition.rs:85:8
|
85 | if true && x == 3 {
LL | if true && x == 3 {
| ^^^^^^^^^^^^^^ help: try: `x == 3`
|
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`

View File

@ -1,7 +1,7 @@
error: equality checks against true are unnecessary
--> $DIR/bool_comparison.rs:13:8
|
13 | if x == true {
LL | if x == true {
| ^^^^^^^^^ help: try simplifying it as shown: `x`
|
= note: `-D clippy::bool-comparison` implied by `-D warnings`
@ -9,79 +9,79 @@ error: equality checks against true are unnecessary
error: equality checks against false can be replaced by a negation
--> $DIR/bool_comparison.rs:18:8
|
18 | if x == false {
LL | if x == false {
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
error: equality checks against true are unnecessary
--> $DIR/bool_comparison.rs:23:8
|
23 | if true == x {
LL | if true == x {
| ^^^^^^^^^ help: try simplifying it as shown: `x`
error: equality checks against false can be replaced by a negation
--> $DIR/bool_comparison.rs:28:8
|
28 | if false == x {
LL | if false == x {
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
error: inequality checks against true can be replaced by a negation
--> $DIR/bool_comparison.rs:33:8
|
33 | if x != true {
LL | if x != true {
| ^^^^^^^^^ help: try simplifying it as shown: `!x`
error: inequality checks against false are unnecessary
--> $DIR/bool_comparison.rs:38:8
|
38 | if x != false {
LL | if x != false {
| ^^^^^^^^^^ help: try simplifying it as shown: `x`
error: inequality checks against true can be replaced by a negation
--> $DIR/bool_comparison.rs:43:8
|
43 | if true != x {
LL | if true != x {
| ^^^^^^^^^ help: try simplifying it as shown: `!x`
error: inequality checks against false are unnecessary
--> $DIR/bool_comparison.rs:48:8
|
48 | if false != x {
LL | if false != x {
| ^^^^^^^^^^ help: try simplifying it as shown: `x`
error: less than comparison against true can be replaced by a negation
--> $DIR/bool_comparison.rs:53:8
|
53 | if x < true {
LL | if x < true {
| ^^^^^^^^ help: try simplifying it as shown: `!x`
error: greater than checks against false are unnecessary
--> $DIR/bool_comparison.rs:58:8
|
58 | if false < x {
LL | if false < x {
| ^^^^^^^^^ help: try simplifying it as shown: `x`
error: greater than checks against false are unnecessary
--> $DIR/bool_comparison.rs:63:8
|
63 | if x > false {
LL | if x > false {
| ^^^^^^^^^ help: try simplifying it as shown: `x`
error: less than comparison against true can be replaced by a negation
--> $DIR/bool_comparison.rs:68:8
|
68 | if true > x {
LL | if true > x {
| ^^^^^^^^ help: try simplifying it as shown: `!x`
error: order comparisons between booleans can be simplified
--> $DIR/bool_comparison.rs:74:8
|
74 | if x < y {
LL | if x < y {
| ^^^^^ help: try simplifying it as shown: `!x & y`
error: order comparisons between booleans can be simplified
--> $DIR/bool_comparison.rs:79:8
|
79 | if x > y {
LL | if x > y {
| ^^^^^ help: try simplifying it as shown: `x & !y`
error: aborting due to 14 previous errors

View File

@ -1,20 +1,20 @@
error: this boolean expression contains a logic bug
--> $DIR/booleans.rs:19:13
|
19 | let _ = a && b || a;
LL | let _ = a && b || a;
| ^^^^^^^^^^^ help: it would look like the following: `a`
|
= note: `-D clippy::logic-bug` implied by `-D warnings`
help: this expression can be optimized out by applying boolean operations to the outer expression
--> $DIR/booleans.rs:19:18
|
19 | let _ = a && b || a;
LL | let _ = a && b || a;
| ^
error: this boolean expression can be simplified
--> $DIR/booleans.rs:21:13
|
21 | let _ = !true;
LL | let _ = !true;
| ^^^^^ help: try: `false`
|
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
@ -22,182 +22,182 @@ error: this boolean expression can be simplified
error: this boolean expression can be simplified
--> $DIR/booleans.rs:22:13
|
22 | let _ = !false;
LL | let _ = !false;
| ^^^^^^ help: try: `true`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:23:13
|
23 | let _ = !!a;
LL | let _ = !!a;
| ^^^ help: try: `a`
error: this boolean expression contains a logic bug
--> $DIR/booleans.rs:24:13
|
24 | let _ = false && a;
LL | let _ = false && a;
| ^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
--> $DIR/booleans.rs:24:22
|
24 | let _ = false && a;
LL | let _ = false && a;
| ^
error: this boolean expression can be simplified
--> $DIR/booleans.rs:25:13
|
25 | let _ = false || a;
LL | let _ = false || a;
| ^^^^^^^^^^ help: try: `a`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:30:13
|
30 | let _ = !(!a && b);
LL | let _ = !(!a && b);
| ^^^^^^^^^^ help: try: `!b || a`
error: this boolean expression contains a logic bug
--> $DIR/booleans.rs:40:13
|
40 | let _ = a == b && a != b;
LL | let _ = a == b && a != b;
| ^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
--> $DIR/booleans.rs:40:13
|
40 | let _ = a == b && a != b;
LL | let _ = a == b && a != b;
| ^^^^^^
error: this boolean expression can be simplified
--> $DIR/booleans.rs:41:13
|
41 | let _ = a == b && c == 5 && a == b;
LL | let _ = a == b && c == 5 && a == b;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try
|
41 | let _ = a == b && c == 5;
LL | let _ = a == b && c == 5;
| ^^^^^^^^^^^^^^^^
41 | let _ = !(c != 5 || a != b);
LL | let _ = !(c != 5 || a != b);
| ^^^^^^^^^^^^^^^^^^^
error: this boolean expression can be simplified
--> $DIR/booleans.rs:42:13
|
42 | let _ = a == b && c == 5 && b == a;
LL | let _ = a == b && c == 5 && b == a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try
|
42 | let _ = a == b && c == 5;
LL | let _ = a == b && c == 5;
| ^^^^^^^^^^^^^^^^
42 | let _ = !(c != 5 || a != b);
LL | let _ = !(c != 5 || a != b);
| ^^^^^^^^^^^^^^^^^^^
error: this boolean expression contains a logic bug
--> $DIR/booleans.rs:43:13
|
43 | let _ = a < b && a >= b;
LL | let _ = a < b && a >= b;
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
--> $DIR/booleans.rs:43:13
|
43 | let _ = a < b && a >= b;
LL | let _ = a < b && a >= b;
| ^^^^^
error: this boolean expression contains a logic bug
--> $DIR/booleans.rs:44:13
|
44 | let _ = a > b && a <= b;
LL | let _ = a > b && a <= b;
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
--> $DIR/booleans.rs:44:13
|
44 | let _ = a > b && a <= b;
LL | let _ = a > b && a <= b;
| ^^^^^
error: this boolean expression can be simplified
--> $DIR/booleans.rs:46:13
|
46 | let _ = a != b || !(a != b || c == d);
LL | let _ = a != b || !(a != b || c == d);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try
|
46 | let _ = c != d || a != b;
LL | let _ = c != d || a != b;
| ^^^^^^^^^^^^^^^^
46 | let _ = !(a == b && c == d);
LL | let _ = !(a == b && c == d);
| ^^^^^^^^^^^^^^^^^^^
error: this boolean expression can be simplified
--> $DIR/booleans.rs:54:13
|
54 | let _ = !a.is_some();
LL | let _ = !a.is_some();
| ^^^^^^^^^^^^ help: try: `a.is_none()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:56:13
|
56 | let _ = !a.is_none();
LL | let _ = !a.is_none();
| ^^^^^^^^^^^^ help: try: `a.is_some()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:58:13
|
58 | let _ = !b.is_err();
LL | let _ = !b.is_err();
| ^^^^^^^^^^^ help: try: `b.is_ok()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:60:13
|
60 | let _ = !b.is_ok();
LL | let _ = !b.is_ok();
| ^^^^^^^^^^ help: try: `b.is_err()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:62:13
|
62 | let _ = !(a.is_some() && !c);
LL | let _ = !(a.is_some() && !c);
| ^^^^^^^^^^^^^^^^^^^^ help: try: `c || a.is_none()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:63:13
|
63 | let _ = !(!c ^ c) || !a.is_some();
LL | let _ = !(!c ^ c) || !a.is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(!c ^ c) || a.is_none()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:64:13
|
64 | let _ = (!c ^ c) || !a.is_some();
LL | let _ = (!c ^ c) || !a.is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(!c ^ c) || a.is_none()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:65:13
|
65 | let _ = !c ^ c || !a.is_some();
LL | let _ = !c ^ c || !a.is_some();
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `!c ^ c || a.is_none()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:137:8
|
137 | if !res.is_ok() {}
| ^^^^^^^^^^^^ help: try: `res.is_err()`
--> $DIR/booleans.rs:137:8
|
LL | if !res.is_ok() {}
| ^^^^^^^^^^^^ help: try: `res.is_err()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:138:8
|
138 | if !res.is_err() {}
| ^^^^^^^^^^^^^ help: try: `res.is_ok()`
--> $DIR/booleans.rs:138:8
|
LL | if !res.is_err() {}
| ^^^^^^^^^^^^^ help: try: `res.is_ok()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:141:8
|
141 | if !res.is_some() {}
| ^^^^^^^^^^^^^^ help: try: `res.is_none()`
--> $DIR/booleans.rs:141:8
|
LL | if !res.is_some() {}
| ^^^^^^^^^^^^^^ help: try: `res.is_none()`
error: this boolean expression can be simplified
--> $DIR/booleans.rs:142:8
|
142 | if !res.is_none() {}
| ^^^^^^^^^^^^^^ help: try: `res.is_some()`
--> $DIR/booleans.rs:142:8
|
LL | if !res.is_none() {}
| ^^^^^^^^^^^^^^ help: try: `res.is_some()`
error: aborting due to 25 previous errors

View File

@ -1,31 +1,31 @@
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> $DIR/borrow_box.rs:15:19
|
15 | pub fn test1(foo: &mut Box<bool>) {
LL | pub fn test1(foo: &mut Box<bool>) {
| ^^^^^^^^^^^^^^ help: try: `&mut bool`
|
note: lint level defined here
--> $DIR/borrow_box.rs:10:9
|
10 | #![deny(clippy::borrowed_box)]
LL | #![deny(clippy::borrowed_box)]
| ^^^^^^^^^^^^^^^^^^^^
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> $DIR/borrow_box.rs:20:14
|
20 | let foo: &Box<bool>;
LL | let foo: &Box<bool>;
| ^^^^^^^^^^ help: try: `&bool`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> $DIR/borrow_box.rs:24:10
|
24 | foo: &'a Box<bool>,
LL | foo: &'a Box<bool>,
| ^^^^^^^^^^^^^ help: try: `&'a bool`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> $DIR/borrow_box.rs:28:17
|
28 | fn test4(a: &Box<bool>);
LL | fn test4(a: &Box<bool>);
| ^^^^^^^^^^ help: try: `&bool`
error: aborting due to 4 previous errors

View File

@ -1,7 +1,7 @@
error: you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`
--> $DIR/box_vec.rs:23:18
|
23 | pub fn test(foo: Box<Vec<bool>>) {
LL | pub fn test(foo: Box<Vec<bool>>) {
| ^^^^^^^^^^^^^^
|
= note: `-D clippy::box-vec` implied by `-D warnings`

View File

@ -1,7 +1,7 @@
error: This generic shadows the built-in type `u32`
--> $DIR/builtin-type-shadow.rs:13:8
|
13 | fn foo<u32>(a: u32) -> u32 {
LL | fn foo<u32>(a: u32) -> u32 {
| ^^^
|
= note: `-D clippy::builtin-type-shadow` implied by `-D warnings`
@ -9,9 +9,9 @@ error: This generic shadows the built-in type `u32`
error[E0308]: mismatched types
--> $DIR/builtin-type-shadow.rs:14:5
|
13 | fn foo<u32>(a: u32) -> u32 {
LL | fn foo<u32>(a: u32) -> u32 {
| --- expected `u32` because of return type
14 | 42
LL | 42
| ^^ expected type parameter, found integral variable
|
= note: expected type `u32`

View File

@ -1,25 +1,25 @@
error: You appear to be counting bytes the naive way
--> $DIR/bytecount.rs:14:13
|
14 | let _ = x.iter().filter(|&&a| a == 0).count(); // naive byte count
LL | let _ = x.iter().filter(|&&a| a == 0).count(); // naive byte count
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider using the bytecount crate: `bytecount::count(x, 0)`
|
note: lint level defined here
--> $DIR/bytecount.rs:10:8
|
10 | #[deny(clippy::naive_bytecount)]
LL | #[deny(clippy::naive_bytecount)]
| ^^^^^^^^^^^^^^^^^^^^^^^
error: You appear to be counting bytes the naive way
--> $DIR/bytecount.rs:16:13
|
16 | let _ = (&x[..]).iter().filter(|&a| *a == 0).count(); // naive byte count
LL | let _ = (&x[..]).iter().filter(|&a| *a == 0).count(); // naive byte count
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider using the bytecount crate: `bytecount::count((&x[..]), 0)`
error: You appear to be counting bytes the naive way
--> $DIR/bytecount.rs:28:13
|
28 | let _ = x.iter().filter(|a| b + 1 == **a).count(); // naive byte count
LL | let _ = x.iter().filter(|a| b + 1 == **a).count(); // naive byte count
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider using the bytecount crate: `bytecount::count(x, b + 1)`
error: aborting due to 3 previous errors

View File

@ -1,7 +1,7 @@
error: casting i32 to f32 causes a loss of precision (i32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
--> $DIR/cast.rs:20:5
|
20 | 1i32 as f32;
LL | 1i32 as f32;
| ^^^^^^^^^^^
|
= note: `-D clippy::cast-precision-loss` implied by `-D warnings`
@ -9,37 +9,37 @@ error: casting i32 to f32 causes a loss of precision (i32 is 32 bits wide, but f
error: casting i64 to f32 causes a loss of precision (i64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
--> $DIR/cast.rs:21:5
|
21 | 1i64 as f32;
LL | 1i64 as f32;
| ^^^^^^^^^^^
error: casting i64 to f64 causes a loss of precision (i64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
--> $DIR/cast.rs:22:5
|
22 | 1i64 as f64;
LL | 1i64 as f64;
| ^^^^^^^^^^^
error: casting u32 to f32 causes a loss of precision (u32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
--> $DIR/cast.rs:23:5
|
23 | 1u32 as f32;
LL | 1u32 as f32;
| ^^^^^^^^^^^
error: casting u64 to f32 causes a loss of precision (u64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
--> $DIR/cast.rs:24:5
|
24 | 1u64 as f32;
LL | 1u64 as f32;
| ^^^^^^^^^^^
error: casting u64 to f64 causes a loss of precision (u64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
--> $DIR/cast.rs:25:5
|
25 | 1u64 as f64;
LL | 1u64 as f64;
| ^^^^^^^^^^^
error: casting f32 to i32 may truncate the value
--> $DIR/cast.rs:27:5
|
27 | 1f32 as i32;
LL | 1f32 as i32;
| ^^^^^^^^^^^
|
= note: `-D clippy::cast-possible-truncation` implied by `-D warnings`
@ -47,13 +47,13 @@ error: casting f32 to i32 may truncate the value
error: casting f32 to u32 may truncate the value
--> $DIR/cast.rs:28:5
|
28 | 1f32 as u32;
LL | 1f32 as u32;
| ^^^^^^^^^^^
error: casting f32 to u32 may lose the sign of the value
--> $DIR/cast.rs:28:5
|
28 | 1f32 as u32;
LL | 1f32 as u32;
| ^^^^^^^^^^^
|
= note: `-D clippy::cast-sign-loss` implied by `-D warnings`
@ -61,49 +61,49 @@ error: casting f32 to u32 may lose the sign of the value
error: casting f64 to f32 may truncate the value
--> $DIR/cast.rs:29:5
|
29 | 1f64 as f32;
LL | 1f64 as f32;
| ^^^^^^^^^^^
error: casting i32 to i8 may truncate the value
--> $DIR/cast.rs:30:5
|
30 | 1i32 as i8;
LL | 1i32 as i8;
| ^^^^^^^^^^
error: casting i32 to u8 may lose the sign of the value
--> $DIR/cast.rs:31:5
|
31 | 1i32 as u8;
LL | 1i32 as u8;
| ^^^^^^^^^^
error: casting i32 to u8 may truncate the value
--> $DIR/cast.rs:31:5
|
31 | 1i32 as u8;
LL | 1i32 as u8;
| ^^^^^^^^^^
error: casting f64 to isize may truncate the value
--> $DIR/cast.rs:32:5
|
32 | 1f64 as isize;
LL | 1f64 as isize;
| ^^^^^^^^^^^^^
error: casting f64 to usize may truncate the value
--> $DIR/cast.rs:33:5
|
33 | 1f64 as usize;
LL | 1f64 as usize;
| ^^^^^^^^^^^^^
error: casting f64 to usize may lose the sign of the value
--> $DIR/cast.rs:33:5
|
33 | 1f64 as usize;
LL | 1f64 as usize;
| ^^^^^^^^^^^^^
error: casting u8 to i8 may wrap around the value
--> $DIR/cast.rs:35:5
|
35 | 1u8 as i8;
LL | 1u8 as i8;
| ^^^^^^^^^
|
= note: `-D clippy::cast-possible-wrap` implied by `-D warnings`
@ -111,31 +111,31 @@ error: casting u8 to i8 may wrap around the value
error: casting u16 to i16 may wrap around the value
--> $DIR/cast.rs:36:5
|
36 | 1u16 as i16;
LL | 1u16 as i16;
| ^^^^^^^^^^^
error: casting u32 to i32 may wrap around the value
--> $DIR/cast.rs:37:5
|
37 | 1u32 as i32;
LL | 1u32 as i32;
| ^^^^^^^^^^^
error: casting u64 to i64 may wrap around the value
--> $DIR/cast.rs:38:5
|
38 | 1u64 as i64;
LL | 1u64 as i64;
| ^^^^^^^^^^^
error: casting usize to isize may wrap around the value
--> $DIR/cast.rs:39:5
|
39 | 1usize as isize;
LL | 1usize as isize;
| ^^^^^^^^^^^^^^^
error: casting f32 to f64 may become silently lossy if types change
--> $DIR/cast.rs:41:5
|
41 | 1.0f32 as f64;
LL | 1.0f32 as f64;
| ^^^^^^^^^^^^^ help: try: `f64::from(1.0f32)`
|
= note: `-D clippy::cast-lossless` implied by `-D warnings`
@ -143,25 +143,25 @@ error: casting f32 to f64 may become silently lossy if types change
error: casting u8 to u16 may become silently lossy if types change
--> $DIR/cast.rs:43:5
|
43 | (1u8 + 1u8) as u16;
LL | (1u8 + 1u8) as u16;
| ^^^^^^^^^^^^^^^^^^ help: try: `u16::from(1u8 + 1u8)`
error: casting i32 to u32 may lose the sign of the value
--> $DIR/cast.rs:45:5
|
45 | 1i32 as u32;
LL | 1i32 as u32;
| ^^^^^^^^^^^
error: casting isize to usize may lose the sign of the value
--> $DIR/cast.rs:46:5
|
46 | 1isize as usize;
LL | 1isize as usize;
| ^^^^^^^^^^^^^^^
error: casting to the same type is unnecessary (`i32` -> `i32`)
--> $DIR/cast.rs:49:5
|
49 | 1i32 as i32;
LL | 1i32 as i32;
| ^^^^^^^^^^^
|
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
@ -169,13 +169,13 @@ error: casting to the same type is unnecessary (`i32` -> `i32`)
error: casting to the same type is unnecessary (`f32` -> `f32`)
--> $DIR/cast.rs:50:5
|
50 | 1f32 as f32;
LL | 1f32 as f32;
| ^^^^^^^^^^^
error: casting to the same type is unnecessary (`bool` -> `bool`)
--> $DIR/cast.rs:51:5
|
51 | false as bool;
LL | false as bool;
| ^^^^^^^^^^^^^
error: aborting due to 28 previous errors

View File

@ -1,7 +1,7 @@
error: casting from `*const u8` to a more-strictly-aligned pointer (`*const u16`)
--> $DIR/cast_alignment.rs:21:5
|
21 | (&1u8 as *const u8) as *const u16;
LL | (&1u8 as *const u8) as *const u16;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::cast-ptr-alignment` implied by `-D warnings`
@ -9,7 +9,7 @@ error: casting from `*const u8` to a more-strictly-aligned pointer (`*const u16`
error: casting from `*mut u8` to a more-strictly-aligned pointer (`*mut u16`)
--> $DIR/cast_alignment.rs:22:5
|
22 | (&mut 1u8 as *mut u8) as *mut u16;
LL | (&mut 1u8 as *mut u8) as *mut u16;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -1,7 +1,7 @@
error: casting i8 to f32 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:14:5
|
14 | 1i8 as f32;
LL | 1i8 as f32;
| ^^^^^^^^^^ help: try: `f32::from(1i8)`
|
= note: `-D clippy::cast-lossless` implied by `-D warnings`
@ -9,55 +9,55 @@ error: casting i8 to f32 may become silently lossy if types change
error: casting i8 to f64 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:15:5
|
15 | 1i8 as f64;
LL | 1i8 as f64;
| ^^^^^^^^^^ help: try: `f64::from(1i8)`
error: casting u8 to f32 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:16:5
|
16 | 1u8 as f32;
LL | 1u8 as f32;
| ^^^^^^^^^^ help: try: `f32::from(1u8)`
error: casting u8 to f64 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:17:5
|
17 | 1u8 as f64;
LL | 1u8 as f64;
| ^^^^^^^^^^ help: try: `f64::from(1u8)`
error: casting i16 to f32 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:18:5
|
18 | 1i16 as f32;
LL | 1i16 as f32;
| ^^^^^^^^^^^ help: try: `f32::from(1i16)`
error: casting i16 to f64 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:19:5
|
19 | 1i16 as f64;
LL | 1i16 as f64;
| ^^^^^^^^^^^ help: try: `f64::from(1i16)`
error: casting u16 to f32 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:20:5
|
20 | 1u16 as f32;
LL | 1u16 as f32;
| ^^^^^^^^^^^ help: try: `f32::from(1u16)`
error: casting u16 to f64 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:21:5
|
21 | 1u16 as f64;
LL | 1u16 as f64;
| ^^^^^^^^^^^ help: try: `f64::from(1u16)`
error: casting i32 to f64 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:22:5
|
22 | 1i32 as f64;
LL | 1i32 as f64;
| ^^^^^^^^^^^ help: try: `f64::from(1i32)`
error: casting u32 to f64 may become silently lossy if types change
--> $DIR/cast_lossless_float.rs:23:5
|
23 | 1u32 as f64;
LL | 1u32 as f64;
| ^^^^^^^^^^^ help: try: `f64::from(1u32)`
error: aborting due to 10 previous errors

View File

@ -1,7 +1,7 @@
error: casting i8 to i16 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:14:5
|
14 | 1i8 as i16;
LL | 1i8 as i16;
| ^^^^^^^^^^ help: try: `i16::from(1i8)`
|
= note: `-D clippy::cast-lossless` implied by `-D warnings`
@ -9,103 +9,103 @@ error: casting i8 to i16 may become silently lossy if types change
error: casting i8 to i32 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:15:5
|
15 | 1i8 as i32;
LL | 1i8 as i32;
| ^^^^^^^^^^ help: try: `i32::from(1i8)`
error: casting i8 to i64 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:16:5
|
16 | 1i8 as i64;
LL | 1i8 as i64;
| ^^^^^^^^^^ help: try: `i64::from(1i8)`
error: casting u8 to i16 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:17:5
|
17 | 1u8 as i16;
LL | 1u8 as i16;
| ^^^^^^^^^^ help: try: `i16::from(1u8)`
error: casting u8 to i32 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:18:5
|
18 | 1u8 as i32;
LL | 1u8 as i32;
| ^^^^^^^^^^ help: try: `i32::from(1u8)`
error: casting u8 to i64 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:19:5
|
19 | 1u8 as i64;
LL | 1u8 as i64;
| ^^^^^^^^^^ help: try: `i64::from(1u8)`
error: casting u8 to u16 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:20:5
|
20 | 1u8 as u16;
LL | 1u8 as u16;
| ^^^^^^^^^^ help: try: `u16::from(1u8)`
error: casting u8 to u32 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:21:5
|
21 | 1u8 as u32;
LL | 1u8 as u32;
| ^^^^^^^^^^ help: try: `u32::from(1u8)`
error: casting u8 to u64 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:22:5
|
22 | 1u8 as u64;
LL | 1u8 as u64;
| ^^^^^^^^^^ help: try: `u64::from(1u8)`
error: casting i16 to i32 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:23:5
|
23 | 1i16 as i32;
LL | 1i16 as i32;
| ^^^^^^^^^^^ help: try: `i32::from(1i16)`
error: casting i16 to i64 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:24:5
|
24 | 1i16 as i64;
LL | 1i16 as i64;
| ^^^^^^^^^^^ help: try: `i64::from(1i16)`
error: casting u16 to i32 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:25:5
|
25 | 1u16 as i32;
LL | 1u16 as i32;
| ^^^^^^^^^^^ help: try: `i32::from(1u16)`
error: casting u16 to i64 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:26:5
|
26 | 1u16 as i64;
LL | 1u16 as i64;
| ^^^^^^^^^^^ help: try: `i64::from(1u16)`
error: casting u16 to u32 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:27:5
|
27 | 1u16 as u32;
LL | 1u16 as u32;
| ^^^^^^^^^^^ help: try: `u32::from(1u16)`
error: casting u16 to u64 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:28:5
|
28 | 1u16 as u64;
LL | 1u16 as u64;
| ^^^^^^^^^^^ help: try: `u64::from(1u16)`
error: casting i32 to i64 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:29:5
|
29 | 1i32 as i64;
LL | 1i32 as i64;
| ^^^^^^^^^^^ help: try: `i64::from(1i32)`
error: casting u32 to i64 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:30:5
|
30 | 1u32 as i64;
LL | 1u32 as i64;
| ^^^^^^^^^^^ help: try: `i64::from(1u32)`
error: casting u32 to u64 may become silently lossy if types change
--> $DIR/cast_lossless_integer.rs:31:5
|
31 | 1u32 as u64;
LL | 1u32 as u64;
| ^^^^^^^^^^^ help: try: `u64::from(1u32)`
error: aborting due to 18 previous errors

View File

@ -1,7 +1,7 @@
error: casting isize to i8 may truncate the value
--> $DIR/cast_size.rs:20:5
|
20 | 1isize as i8;
LL | 1isize as i8;
| ^^^^^^^^^^^^
|
= note: `-D clippy::cast-possible-truncation` implied by `-D warnings`
@ -9,7 +9,7 @@ error: casting isize to i8 may truncate the value
error: casting isize to f64 causes a loss of precision on targets with 64-bit wide pointers (isize is 64 bits wide, but f64's mantissa is only 52 bits wide)
--> $DIR/cast_size.rs:21:5
|
21 | 1isize as f64;
LL | 1isize as f64;
| ^^^^^^^^^^^^^
|
= note: `-D clippy::cast-precision-loss` implied by `-D warnings`
@ -17,31 +17,31 @@ error: casting isize to f64 causes a loss of precision on targets with 64-bit wi
error: casting usize to f64 causes a loss of precision on targets with 64-bit wide pointers (usize is 64 bits wide, but f64's mantissa is only 52 bits wide)
--> $DIR/cast_size.rs:22:5
|
22 | 1usize as f64;
LL | 1usize as f64;
| ^^^^^^^^^^^^^
error: casting isize to f32 causes a loss of precision (isize is 32 or 64 bits wide, but f32's mantissa is only 23 bits wide)
--> $DIR/cast_size.rs:23:5
|
23 | 1isize as f32;
LL | 1isize as f32;
| ^^^^^^^^^^^^^
error: casting usize to f32 causes a loss of precision (usize is 32 or 64 bits wide, but f32's mantissa is only 23 bits wide)
--> $DIR/cast_size.rs:24:5
|
24 | 1usize as f32;
LL | 1usize as f32;
| ^^^^^^^^^^^^^
error: casting isize to i32 may truncate the value on targets with 64-bit wide pointers
--> $DIR/cast_size.rs:25:5
|
25 | 1isize as i32;
LL | 1isize as i32;
| ^^^^^^^^^^^^^
error: casting isize to u32 may lose the sign of the value
--> $DIR/cast_size.rs:26:5
|
26 | 1isize as u32;
LL | 1isize as u32;
| ^^^^^^^^^^^^^
|
= note: `-D clippy::cast-sign-loss` implied by `-D warnings`
@ -49,25 +49,25 @@ error: casting isize to u32 may lose the sign of the value
error: casting isize to u32 may truncate the value on targets with 64-bit wide pointers
--> $DIR/cast_size.rs:26:5
|
26 | 1isize as u32;
LL | 1isize as u32;
| ^^^^^^^^^^^^^
error: casting usize to u32 may truncate the value on targets with 64-bit wide pointers
--> $DIR/cast_size.rs:27:5
|
27 | 1usize as u32;
LL | 1usize as u32;
| ^^^^^^^^^^^^^
error: casting usize to i32 may truncate the value on targets with 64-bit wide pointers
--> $DIR/cast_size.rs:28:5
|
28 | 1usize as i32;
LL | 1usize as i32;
| ^^^^^^^^^^^^^
error: casting usize to i32 may wrap around the value on targets with 32-bit wide pointers
--> $DIR/cast_size.rs:28:5
|
28 | 1usize as i32;
LL | 1usize as i32;
| ^^^^^^^^^^^^^
|
= note: `-D clippy::cast-possible-wrap` implied by `-D warnings`
@ -75,49 +75,49 @@ error: casting usize to i32 may wrap around the value on targets with 32-bit wid
error: casting i64 to isize may truncate the value on targets with 32-bit wide pointers
--> $DIR/cast_size.rs:30:5
|
30 | 1i64 as isize;
LL | 1i64 as isize;
| ^^^^^^^^^^^^^
error: casting i64 to usize may lose the sign of the value
--> $DIR/cast_size.rs:31:5
|
31 | 1i64 as usize;
LL | 1i64 as usize;
| ^^^^^^^^^^^^^
error: casting i64 to usize may truncate the value on targets with 32-bit wide pointers
--> $DIR/cast_size.rs:31:5
|
31 | 1i64 as usize;
LL | 1i64 as usize;
| ^^^^^^^^^^^^^
error: casting u64 to isize may truncate the value on targets with 32-bit wide pointers
--> $DIR/cast_size.rs:32:5
|
32 | 1u64 as isize;
LL | 1u64 as isize;
| ^^^^^^^^^^^^^
error: casting u64 to isize may wrap around the value on targets with 64-bit wide pointers
--> $DIR/cast_size.rs:32:5
|
32 | 1u64 as isize;
LL | 1u64 as isize;
| ^^^^^^^^^^^^^
error: casting u64 to usize may truncate the value on targets with 32-bit wide pointers
--> $DIR/cast_size.rs:33:5
|
33 | 1u64 as usize;
LL | 1u64 as usize;
| ^^^^^^^^^^^^^
error: casting u32 to isize may wrap around the value on targets with 32-bit wide pointers
--> $DIR/cast_size.rs:34:5
|
34 | 1u32 as isize;
LL | 1u32 as isize;
| ^^^^^^^^^^^^^
error: casting i32 to usize may lose the sign of the value
--> $DIR/cast_size.rs:37:5
|
37 | 1i32 as usize;
LL | 1i32 as usize;
| ^^^^^^^^^^^^^
error: aborting due to 19 previous errors

View File

@ -1,7 +1,7 @@
error: `cfg_attr` is deprecated for rustfmt and got replaced by tool_attributes
--> $DIR/cfg_attr_rustfmt.rs:25:5
|
25 | #[cfg_attr(rustfmt, rustfmt::skip)]
LL | #[cfg_attr(rustfmt, rustfmt::skip)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `#[rustfmt::skip]`
|
= note: `-D clippy::deprecated-cfg-attr` implied by `-D warnings`
@ -9,13 +9,13 @@ error: `cfg_attr` is deprecated for rustfmt and got replaced by tool_attributes
error: `cfg_attr` is deprecated for rustfmt and got replaced by tool_attributes
--> $DIR/cfg_attr_rustfmt.rs:29:1
|
29 | #[cfg_attr(rustfmt, rustfmt_skip)]
LL | #[cfg_attr(rustfmt, rustfmt_skip)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `#[rustfmt::skip]`
error: `cfg_attr` is deprecated for rustfmt and got replaced by tool_attributes
--> $DIR/cfg_attr_rustfmt.rs:35:5
|
35 | #![cfg_attr(rustfmt, rustfmt_skip)]
LL | #![cfg_attr(rustfmt, rustfmt_skip)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `#![rustfmt::skip]`
error: aborting due to 3 previous errors

View File

@ -1,7 +1,7 @@
error: casting character literal to u8. `char`s are 4 bytes wide in rust, so casting to u8 truncates them
--> $DIR/char_lit_as_u8.rs:13:13
|
13 | let c = 'a' as u8;
LL | let c = 'a' as u8;
| ^^^^^^^^^
|
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`

View File

@ -1,313 +1,313 @@
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:16:9
|
15 | if x.is_some() {
LL | if x.is_some() {
| ----------- the check is happening here
16 | x.unwrap(); // unnecessary
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
|
note: lint level defined here
--> $DIR/checked_unwrap.rs:10:35
|
10 | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:18:9
|
15 | if x.is_some() {
LL | if x.is_some() {
| ----------- because of this check
...
18 | x.unwrap(); // will panic
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
|
note: lint level defined here
--> $DIR/checked_unwrap.rs:10:9
|
10 | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:21:9
|
20 | if x.is_none() {
LL | if x.is_none() {
| ----------- because of this check
21 | x.unwrap(); // will panic
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:23:9
|
20 | if x.is_none() {
LL | if x.is_none() {
| ----------- the check is happening here
...
23 | x.unwrap(); // unnecessary
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:27:9
|
26 | if x.is_ok() {
LL | if x.is_ok() {
| --------- the check is happening here
27 | x.unwrap(); // unnecessary
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/checked_unwrap.rs:28:9
|
26 | if x.is_ok() {
LL | if x.is_ok() {
| --------- because of this check
27 | x.unwrap(); // unnecessary
28 | x.unwrap_err(); // will panic
LL | x.unwrap(); // unnecessary
LL | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:30:9
|
26 | if x.is_ok() {
LL | if x.is_ok() {
| --------- because of this check
...
30 | x.unwrap(); // will panic
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:31:9
|
26 | if x.is_ok() {
LL | if x.is_ok() {
| --------- the check is happening here
...
31 | x.unwrap_err(); // unnecessary
LL | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:34:9
|
33 | if x.is_err() {
LL | if x.is_err() {
| ---------- because of this check
34 | x.unwrap(); // will panic
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:35:9
|
33 | if x.is_err() {
LL | if x.is_err() {
| ---------- the check is happening here
34 | x.unwrap(); // will panic
35 | x.unwrap_err(); // unnecessary
LL | x.unwrap(); // will panic
LL | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:37:9
|
33 | if x.is_err() {
LL | if x.is_err() {
| ---------- the check is happening here
...
37 | x.unwrap(); // unnecessary
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/checked_unwrap.rs:38:9
|
33 | if x.is_err() {
LL | if x.is_err() {
| ---------- because of this check
...
38 | x.unwrap_err(); // will panic
LL | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:55:9
|
54 | if x.is_ok() && y.is_err() {
LL | if x.is_ok() && y.is_err() {
| --------- the check is happening here
55 | x.unwrap(); // unnecessary
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/checked_unwrap.rs:56:9
|
54 | if x.is_ok() && y.is_err() {
LL | if x.is_ok() && y.is_err() {
| --------- because of this check
55 | x.unwrap(); // unnecessary
56 | x.unwrap_err(); // will panic
LL | x.unwrap(); // unnecessary
LL | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:57:9
|
54 | if x.is_ok() && y.is_err() {
LL | if x.is_ok() && y.is_err() {
| ---------- because of this check
...
57 | y.unwrap(); // will panic
LL | y.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:58:9
|
54 | if x.is_ok() && y.is_err() {
LL | if x.is_ok() && y.is_err() {
| ---------- the check is happening here
...
58 | y.unwrap_err(); // unnecessary
LL | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:72:9
|
67 | if x.is_ok() || y.is_ok() {
LL | if x.is_ok() || y.is_ok() {
| --------- because of this check
...
72 | x.unwrap(); // will panic
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:73:9
|
67 | if x.is_ok() || y.is_ok() {
LL | if x.is_ok() || y.is_ok() {
| --------- the check is happening here
...
73 | x.unwrap_err(); // unnecessary
LL | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:74:9
|
67 | if x.is_ok() || y.is_ok() {
LL | if x.is_ok() || y.is_ok() {
| --------- because of this check
...
74 | y.unwrap(); // will panic
LL | y.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:75:9
|
67 | if x.is_ok() || y.is_ok() {
LL | if x.is_ok() || y.is_ok() {
| --------- the check is happening here
...
75 | y.unwrap_err(); // unnecessary
LL | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:79:9
|
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- the check is happening here
79 | x.unwrap(); // unnecessary
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/checked_unwrap.rs:80:9
|
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
79 | x.unwrap(); // unnecessary
80 | x.unwrap_err(); // will panic
LL | x.unwrap(); // unnecessary
LL | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:81:9
|
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
...
81 | y.unwrap(); // will panic
LL | y.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:82:9
|
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- the check is happening here
...
82 | y.unwrap_err(); // unnecessary
LL | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:83:9
|
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| ---------- the check is happening here
...
83 | z.unwrap(); // unnecessary
LL | z.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/checked_unwrap.rs:84:9
|
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| ---------- because of this check
...
84 | z.unwrap_err(); // will panic
LL | z.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:92:9
|
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
...
92 | x.unwrap(); // will panic
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:93:9
|
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- the check is happening here
...
93 | x.unwrap_err(); // unnecessary
LL | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:94:9
|
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- the check is happening here
...
94 | y.unwrap(); // unnecessary
LL | y.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/checked_unwrap.rs:95:9
|
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
...
95 | y.unwrap_err(); // will panic
LL | y.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:96:9
|
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| ---------- because of this check
...
96 | z.unwrap(); // will panic
LL | z.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:97:9
|
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| ---------- the check is happening here
...
97 | z.unwrap_err(); // unnecessary
LL | z.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/checked_unwrap.rs:105:13
|
104 | if x.is_some() {
| ----------- the check is happening here
105 | x.unwrap(); // unnecessary
| ^^^^^^^^^^
--> $DIR/checked_unwrap.rs:105:13
|
LL | if x.is_some() {
| ----------- the check is happening here
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/checked_unwrap.rs:107:13
|
104 | if x.is_some() {
| ----------- because of this check
--> $DIR/checked_unwrap.rs:107:13
|
LL | if x.is_some() {
| ----------- because of this check
...
107 | x.unwrap(); // will panic
| ^^^^^^^^^^
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
error: aborting due to 34 previous errors

View File

@ -1,7 +1,7 @@
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:14:5
|
14 | x == std::f32::NAN;
LL | x == std::f32::NAN;
| ^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::cmp-nan` implied by `-D warnings`
@ -9,67 +9,67 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:15:5
|
15 | x != std::f32::NAN;
LL | x != std::f32::NAN;
| ^^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:16:5
|
16 | x < std::f32::NAN;
LL | x < std::f32::NAN;
| ^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:17:5
|
17 | x > std::f32::NAN;
LL | x > std::f32::NAN;
| ^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:18:5
|
18 | x <= std::f32::NAN;
LL | x <= std::f32::NAN;
| ^^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:19:5
|
19 | x >= std::f32::NAN;
LL | x >= std::f32::NAN;
| ^^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:22:5
|
22 | y == std::f64::NAN;
LL | y == std::f64::NAN;
| ^^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:23:5
|
23 | y != std::f64::NAN;
LL | y != std::f64::NAN;
| ^^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:24:5
|
24 | y < std::f64::NAN;
LL | y < std::f64::NAN;
| ^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:25:5
|
25 | y > std::f64::NAN;
LL | y > std::f64::NAN;
| ^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:26:5
|
26 | y <= std::f64::NAN;
LL | y <= std::f64::NAN;
| ^^^^^^^^^^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
--> $DIR/cmp_nan.rs:27:5
|
27 | y >= std::f64::NAN;
LL | y >= std::f64::NAN;
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 12 previous errors

View File

@ -1,7 +1,7 @@
error: Comparing with null is better expressed by the .is_null() method
--> $DIR/cmp_null.rs:18:8
|
18 | if p == ptr::null() {
LL | if p == ptr::null() {
| ^^^^^^^^^^^^^^^^
|
= note: `-D clippy::cmp-null` implied by `-D warnings`
@ -9,7 +9,7 @@ error: Comparing with null is better expressed by the .is_null() method
error: Comparing with null is better expressed by the .is_null() method
--> $DIR/cmp_null.rs:23:8
|
23 | if m == ptr::null_mut() {
LL | if m == ptr::null_mut() {
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -1,7 +1,7 @@
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:14:14
|
14 | x != "foo".to_string();
LL | x != "foo".to_string();
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
= note: `-D clippy::cmp-owned` implied by `-D warnings`
@ -9,49 +9,49 @@ error: this creates an owned instance just for comparison
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:16:9
|
16 | "foo".to_string() != x;
LL | "foo".to_string() != x;
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:23:10
|
23 | x != "foo".to_owned();
LL | x != "foo".to_owned();
| ^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:25:10
|
25 | x != String::from("foo");
LL | x != String::from("foo");
| ^^^^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:29:5
|
29 | Foo.to_owned() == Foo;
LL | Foo.to_owned() == Foo;
| ^^^^^^^^^^^^^^ help: try: `Foo`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:31:30
|
31 | "abc".chars().filter(|c| c.to_owned() != 'X');
LL | "abc".chars().filter(|c| c.to_owned() != 'X');
| ^^^^^^^^^^^^ help: try: `*c`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:38:5
|
38 | y.to_owned() == *x;
LL | y.to_owned() == *x;
| ^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:43:5
|
43 | y.to_owned() == **x;
LL | y.to_owned() == **x;
| ^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:50:9
|
50 | self.to_owned() == *other
LL | self.to_owned() == *other
| ^^^^^^^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: aborting due to 9 previous errors

View File

@ -1,260 +1,260 @@
error: this if statement can be collapsed
--> $DIR/collapsible_if.rs:15:5
|
15 | / if x == "hello" {
16 | | if y == "world" {
17 | | println!("Hello world!");
18 | | }
19 | | }
LL | / if x == "hello" {
LL | | if y == "world" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
= note: `-D clippy::collapsible-if` implied by `-D warnings`
help: try
|
15 | if x == "hello" && y == "world" {
16 | println!("Hello world!");
17 | }
LL | if x == "hello" && y == "world" {
LL | println!("Hello world!");
LL | }
|
error: this if statement can be collapsed
--> $DIR/collapsible_if.rs:21:5
|
21 | / if x == "hello" || x == "world" {
22 | | if y == "world" || y == "hello" {
23 | | println!("Hello world!");
24 | | }
25 | | }
LL | / if x == "hello" || x == "world" {
LL | | if y == "world" || y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
help: try
|
21 | if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
22 | println!("Hello world!");
23 | }
LL | if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
LL | println!("Hello world!");
LL | }
|
error: this if statement can be collapsed
--> $DIR/collapsible_if.rs:27:5
|
27 | / if x == "hello" && x == "world" {
28 | | if y == "world" || y == "hello" {
29 | | println!("Hello world!");
30 | | }
31 | | }
LL | / if x == "hello" && x == "world" {
LL | | if y == "world" || y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
help: try
|
27 | if x == "hello" && x == "world" && (y == "world" || y == "hello") {
28 | println!("Hello world!");
29 | }
LL | if x == "hello" && x == "world" && (y == "world" || y == "hello") {
LL | println!("Hello world!");
LL | }
|
error: this if statement can be collapsed
--> $DIR/collapsible_if.rs:33:5
|
33 | / if x == "hello" || x == "world" {
34 | | if y == "world" && y == "hello" {
35 | | println!("Hello world!");
36 | | }
37 | | }
LL | / if x == "hello" || x == "world" {
LL | | if y == "world" && y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
help: try
|
33 | if (x == "hello" || x == "world") && y == "world" && y == "hello" {
34 | println!("Hello world!");
35 | }
LL | if (x == "hello" || x == "world") && y == "world" && y == "hello" {
LL | println!("Hello world!");
LL | }
|
error: this if statement can be collapsed
--> $DIR/collapsible_if.rs:39:5
|
39 | / if x == "hello" && x == "world" {
40 | | if y == "world" && y == "hello" {
41 | | println!("Hello world!");
42 | | }
43 | | }
LL | / if x == "hello" && x == "world" {
LL | | if y == "world" && y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
help: try
|
39 | if x == "hello" && x == "world" && y == "world" && y == "hello" {
40 | println!("Hello world!");
41 | }
LL | if x == "hello" && x == "world" && y == "world" && y == "hello" {
LL | println!("Hello world!");
LL | }
|
error: this if statement can be collapsed
--> $DIR/collapsible_if.rs:45:5
|
45 | / if 42 == 1337 {
46 | | if 'a' != 'A' {
47 | | println!("world!")
48 | | }
49 | | }
LL | / if 42 == 1337 {
LL | | if 'a' != 'A' {
LL | | println!("world!")
LL | | }
LL | | }
| |_____^
help: try
|
45 | if 42 == 1337 && 'a' != 'A' {
46 | println!("world!")
47 | }
LL | if 42 == 1337 && 'a' != 'A' {
LL | println!("world!")
LL | }
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_if.rs:54:12
|
54 | } else {
LL | } else {
| ____________^
55 | | if y == "world" {
56 | | println!("world!")
57 | | }
58 | | }
LL | | if y == "world" {
LL | | println!("world!")
LL | | }
LL | | }
| |_____^
help: try
|
54 | } else if y == "world" {
55 | println!("world!")
56 | }
LL | } else if y == "world" {
LL | println!("world!")
LL | }
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_if.rs:62:12
|
62 | } else {
LL | } else {
| ____________^
63 | | if let Some(42) = Some(42) {
64 | | println!("world!")
65 | | }
66 | | }
LL | | if let Some(42) = Some(42) {
LL | | println!("world!")
LL | | }
LL | | }
| |_____^
help: try
|
62 | } else if let Some(42) = Some(42) {
63 | println!("world!")
64 | }
LL | } else if let Some(42) = Some(42) {
LL | println!("world!")
LL | }
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_if.rs:70:12
|
70 | } else {
LL | } else {
| ____________^
71 | | if y == "world" {
72 | | println!("world")
73 | | }
LL | | if y == "world" {
LL | | println!("world")
LL | | }
... |
76 | | }
77 | | }
LL | | }
LL | | }
| |_____^
help: try
|
70 | } else if y == "world" {
71 | println!("world")
72 | }
73 | else {
74 | println!("!")
75 | }
LL | } else if y == "world" {
LL | println!("world")
LL | }
LL | else {
LL | println!("!")
LL | }
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_if.rs:81:12
|
81 | } else {
LL | } else {
| ____________^
82 | | if let Some(42) = Some(42) {
83 | | println!("world")
84 | | }
LL | | if let Some(42) = Some(42) {
LL | | println!("world")
LL | | }
... |
87 | | }
88 | | }
LL | | }
LL | | }
| |_____^
help: try
|
81 | } else if let Some(42) = Some(42) {
82 | println!("world")
83 | }
84 | else {
85 | println!("!")
86 | }
LL | } else if let Some(42) = Some(42) {
LL | println!("world")
LL | }
LL | else {
LL | println!("!")
LL | }
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_if.rs:92:12
|
92 | } else {
LL | } else {
| ____________^
93 | | if let Some(42) = Some(42) {
94 | | println!("world")
95 | | }
LL | | if let Some(42) = Some(42) {
LL | | println!("world")
LL | | }
... |
98 | | }
99 | | }
LL | | }
LL | | }
| |_____^
help: try
|
92 | } else if let Some(42) = Some(42) {
93 | println!("world")
94 | }
95 | else {
96 | println!("!")
97 | }
LL | } else if let Some(42) = Some(42) {
LL | println!("world")
LL | }
LL | else {
LL | println!("!")
LL | }
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_if.rs:103:12
|
103 | } else {
| ____________^
104 | | if x == "hello" {
105 | | println!("world")
106 | | }
... |
109 | | }
110 | | }
| |_____^
--> $DIR/collapsible_if.rs:103:12
|
LL | } else {
| ____________^
LL | | if x == "hello" {
LL | | println!("world")
LL | | }
... |
LL | | }
LL | | }
| |_____^
help: try
|
103 | } else if x == "hello" {
104 | println!("world")
105 | }
106 | else {
107 | println!("!")
108 | }
|
|
LL | } else if x == "hello" {
LL | println!("world")
LL | }
LL | else {
LL | println!("!")
LL | }
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_if.rs:114:12
|
114 | } else {
| ____________^
115 | | if let Some(42) = Some(42) {
116 | | println!("world")
117 | | }
... |
120 | | }
121 | | }
| |_____^
--> $DIR/collapsible_if.rs:114:12
|
LL | } else {
| ____________^
LL | | if let Some(42) = Some(42) {
LL | | println!("world")
LL | | }
... |
LL | | }
LL | | }
| |_____^
help: try
|
114 | } else if let Some(42) = Some(42) {
115 | println!("world")
116 | }
117 | else {
118 | println!("!")
119 | }
|
|
LL | } else if let Some(42) = Some(42) {
LL | println!("world")
LL | }
LL | else {
LL | println!("!")
LL | }
|
error: this if statement can be collapsed
--> $DIR/collapsible_if.rs:173:5
|
173 | / if x == "hello" {
174 | | if y == "world" { // Collapsible
175 | | println!("Hello world!");
176 | | }
177 | | }
| |_____^
--> $DIR/collapsible_if.rs:173:5
|
LL | / if x == "hello" {
LL | | if y == "world" { // Collapsible
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
help: try
|
173 | if x == "hello" && y == "world" { // Collapsible
174 | println!("Hello world!");
175 | }
|
|
LL | if x == "hello" && y == "world" { // Collapsible
LL | println!("Hello world!");
LL | }
|
error: aborting due to 14 previous errors

View File

@ -1,7 +1,7 @@
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:16:12
|
16 | const CST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
LL | const CST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::type-complexity` implied by `-D warnings`
@ -9,85 +9,85 @@ error: very complex type used. Consider factoring parts into `type` definitions
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:17:12
|
17 | static ST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
LL | static ST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:20:8
|
20 | f: Vec<Vec<Box<(u32, u32, u32, u32)>>>,
LL | f: Vec<Vec<Box<(u32, u32, u32, u32)>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:23:11
|
23 | struct TS(Vec<Vec<Box<(u32, u32, u32, u32)>>>);
LL | struct TS(Vec<Vec<Box<(u32, u32, u32, u32)>>>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:26:11
|
26 | Tuple(Vec<Vec<Box<(u32, u32, u32, u32)>>>),
LL | Tuple(Vec<Vec<Box<(u32, u32, u32, u32)>>>),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:27:17
|
27 | Struct { f: Vec<Vec<Box<(u32, u32, u32, u32)>>> },
LL | Struct { f: Vec<Vec<Box<(u32, u32, u32, u32)>>> },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:31:14
|
31 | const A: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
LL | const A: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:32:30
|
32 | fn impl_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) {}
LL | fn impl_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:36:14
|
36 | const A: Vec<Vec<Box<(u32, u32, u32, u32)>>>;
LL | const A: Vec<Vec<Box<(u32, u32, u32, u32)>>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:37:14
|
37 | type B = Vec<Vec<Box<(u32, u32, u32, u32)>>>;
LL | type B = Vec<Vec<Box<(u32, u32, u32, u32)>>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:38:25
|
38 | fn method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>);
LL | fn method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:39:29
|
39 | fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) {}
LL | fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:42:15
|
42 | fn test1() -> Vec<Vec<Box<(u32, u32, u32, u32)>>> {
LL | fn test1() -> Vec<Vec<Box<(u32, u32, u32, u32)>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:46:14
|
46 | fn test2(_x: Vec<Vec<Box<(u32, u32, u32, u32)>>>) {}
LL | fn test2(_x: Vec<Vec<Box<(u32, u32, u32, u32)>>>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/complex_types.rs:49:13
|
49 | let _y: Vec<Vec<Box<(u32, u32, u32, u32)>>> = vec![];
LL | let _y: Vec<Vec<Box<(u32, u32, u32, u32)>>> = vec![];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 15 previous errors

View File

@ -1,7 +1,7 @@
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:13:17
|
13 | const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static.
LL | const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static.
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= note: `-D clippy::const-static-lifetime` implied by `-D warnings`
@ -9,73 +9,73 @@ error: Constants have by default a `'static` lifetime
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:17:21
|
17 | const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static
LL | const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static
| -^^^^^^^---- help: consider removing `'static`: `&str`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:19:32
|
19 | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
LL | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
| -^^^^^^^---- help: consider removing `'static`: `&str`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:19:47
|
19 | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
LL | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
| -^^^^^^^---- help: consider removing `'static`: `&str`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:21:18
|
21 | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
LL | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
| -^^^^^^^------------------ help: consider removing `'static`: `&[&[&'static str]]`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:21:30
|
21 | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
LL | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
| -^^^^^^^---- help: consider removing `'static`: `&str`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:23:17
|
23 | const VAR_SIX: &'static u8 = &5;
LL | const VAR_SIX: &'static u8 = &5;
| -^^^^^^^--- help: consider removing `'static`: `&u8`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:25:29
|
25 | const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
LL | const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
| -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:25:39
|
25 | const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
LL | const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
| -^^^^^^^---- help: consider removing `'static`: `&str`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:27:20
|
27 | const VAR_HEIGHT: &'static Foo = &Foo {};
LL | const VAR_HEIGHT: &'static Foo = &Foo {};
| -^^^^^^^---- help: consider removing `'static`: `&Foo`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:29:19
|
29 | const VAR_SLICE: &'static [u8] = b"Test constant #1"; // ERROR Consider removing 'static.
LL | const VAR_SLICE: &'static [u8] = b"Test constant #1"; // ERROR Consider removing 'static.
| -^^^^^^^----- help: consider removing `'static`: `&[u8]`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:31:19
|
31 | const VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR Consider removing 'static.
LL | const VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR Consider removing 'static.
| -^^^^^^^--------- help: consider removing `'static`: `&(u8, u8)`
error: Constants have by default a `'static` lifetime
--> $DIR/const_static_lifetime.rs:33:19
|
33 | const VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR Consider removing 'static.
LL | const VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR Consider removing 'static.
| -^^^^^^^-------- help: consider removing `'static`: `&[u8; 1]`
error: aborting due to 13 previous errors

View File

@ -1,392 +1,392 @@
error: this `if` has identical blocks
--> $DIR/copies.rs:50:12
|
50 | } else {
LL | } else {
| ____________^
51 | | //~ ERROR same body as `if` block
52 | | Foo { bar: 42 };
53 | | 0..10;
LL | | //~ ERROR same body as `if` block
LL | | Foo { bar: 42 };
LL | | 0..10;
... |
58 | | foo();
59 | | }
LL | | foo();
LL | | }
| |_____^
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this
--> $DIR/copies.rs:42:13
|
42 | if true {
LL | if true {
| _____________^
43 | | Foo { bar: 42 };
44 | | 0..10;
45 | | ..;
LL | | Foo { bar: 42 };
LL | | 0..10;
LL | | ..;
... |
49 | | foo();
50 | | } else {
LL | | foo();
LL | | } else {
| |_____^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:96:14
|
96 | _ => {
| ______________^
97 | | //~ ERROR match arms have same body
98 | | foo();
99 | | let mut a = 42 + [23].len() as i32;
... |
104 | | a
105 | | },
| |_________^
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
--> $DIR/copies.rs:96:14
|
LL | _ => {
| ______________^
LL | | //~ ERROR match arms have same body
LL | | foo();
LL | | let mut a = 42 + [23].len() as i32;
... |
LL | | a
LL | | },
| |_________^
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
note: same as this
--> $DIR/copies.rs:87:15
|
87 | 42 => {
| _______________^
88 | | foo();
89 | | let mut a = 42 + [23].len() as i32;
90 | | if true {
... |
94 | | a
95 | | },
| |_________^
--> $DIR/copies.rs:87:15
|
LL | 42 => {
| _______________^
LL | | foo();
LL | | let mut a = 42 + [23].len() as i32;
LL | | if true {
... |
LL | | a
LL | | },
| |_________^
note: `42` has the same arm body as the `_` wildcard, consider removing it`
--> $DIR/copies.rs:87:15
|
87 | 42 => {
| _______________^
88 | | foo();
89 | | let mut a = 42 + [23].len() as i32;
90 | | if true {
... |
94 | | a
95 | | },
| |_________^
--> $DIR/copies.rs:87:15
|
LL | 42 => {
| _______________^
LL | | foo();
LL | | let mut a = 42 + [23].len() as i32;
LL | | if true {
... |
LL | | a
LL | | },
| |_________^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:111:14
|
111 | _ => 0, //~ ERROR match arms have same body
| ^
|
--> $DIR/copies.rs:111:14
|
LL | _ => 0, //~ ERROR match arms have same body
| ^
|
note: same as this
--> $DIR/copies.rs:109:19
|
109 | Abc::A => 0,
| ^
--> $DIR/copies.rs:109:19
|
LL | Abc::A => 0,
| ^
note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
--> $DIR/copies.rs:109:19
|
109 | Abc::A => 0,
| ^
--> $DIR/copies.rs:109:19
|
LL | Abc::A => 0,
| ^
error: this `if` has identical blocks
--> $DIR/copies.rs:120:12
|
120 | } else {
| ____________^
121 | | //~ ERROR same body as `if` block
122 | | 42
123 | | };
| |_____^
|
--> $DIR/copies.rs:120:12
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | 42
LL | | };
| |_____^
|
note: same as this
--> $DIR/copies.rs:118:21
|
118 | let _ = if true {
| _____________________^
119 | | 42
120 | | } else {
| |_____^
--> $DIR/copies.rs:118:21
|
LL | let _ = if true {
| _____________________^
LL | | 42
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:134:12
|
134 | } else {
| ____________^
135 | | //~ ERROR same body as `if` block
136 | | for _ in &[42] {
137 | | let foo: &Option<_> = &Some::<u8>(42);
... |
143 | | }
144 | | }
| |_____^
|
--> $DIR/copies.rs:134:12
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | for _ in &[42] {
LL | | let foo: &Option<_> = &Some::<u8>(42);
... |
LL | | }
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:125:13
|
125 | if true {
| _____________^
126 | | for _ in &[42] {
127 | | let foo: &Option<_> = &Some::<u8>(42);
128 | | if true {
... |
133 | | }
134 | | } else {
| |_____^
--> $DIR/copies.rs:125:13
|
LL | if true {
| _____________^
LL | | for _ in &[42] {
LL | | let foo: &Option<_> = &Some::<u8>(42);
LL | | if true {
... |
LL | | }
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:153:12
|
153 | } else {
| ____________^
154 | | //~ ERROR same body as `if` block
155 | | let bar = if true { 42 } else { 43 };
156 | |
... |
160 | | bar + 1;
161 | | }
| |_____^
|
--> $DIR/copies.rs:153:12
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | let bar = if true { 42 } else { 43 };
LL | |
... |
LL | | bar + 1;
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:146:13
|
146 | if true {
| _____________^
147 | | let bar = if true { 42 } else { 43 };
148 | |
149 | | while foo() {
... |
152 | | bar + 1;
153 | | } else {
| |_____^
--> $DIR/copies.rs:146:13
|
LL | if true {
| _____________^
LL | | let bar = if true { 42 } else { 43 };
LL | |
LL | | while foo() {
... |
LL | | bar + 1;
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:183:12
|
183 | } else {
| ____________^
184 | | //~ ERROR same body as `if` block
185 | | if let Some(a) = Some(42) {}
186 | | }
| |_____^
|
--> $DIR/copies.rs:183:12
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | if let Some(a) = Some(42) {}
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:181:13
|
181 | if true {
| _____________^
182 | | if let Some(a) = Some(42) {}
183 | | } else {
| |_____^
--> $DIR/copies.rs:181:13
|
LL | if true {
| _____________^
LL | | if let Some(a) = Some(42) {}
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:190:12
|
190 | } else {
| ____________^
191 | | //~ ERROR same body as `if` block
192 | | if let (1, .., 3) = (1, 2, 3) {}
193 | | }
| |_____^
|
--> $DIR/copies.rs:190:12
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | if let (1, .., 3) = (1, 2, 3) {}
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:188:13
|
188 | if true {
| _____________^
189 | | if let (1, .., 3) = (1, 2, 3) {}
190 | | } else {
| |_____^
--> $DIR/copies.rs:188:13
|
LL | if true {
| _____________^
LL | | if let (1, .., 3) = (1, 2, 3) {}
LL | | } else {
| |_____^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:239:15
|
239 | 51 => foo(), //~ ERROR match arms have same body
| ^^^^^
|
--> $DIR/copies.rs:239:15
|
LL | 51 => foo(), //~ ERROR match arms have same body
| ^^^^^
|
note: same as this
--> $DIR/copies.rs:238:15
|
238 | 42 => foo(),
| ^^^^^
--> $DIR/copies.rs:238:15
|
LL | 42 => foo(),
| ^^^^^
note: consider refactoring into `42 | 51`
--> $DIR/copies.rs:238:15
|
238 | 42 => foo(),
| ^^^^^
--> $DIR/copies.rs:238:15
|
LL | 42 => foo(),
| ^^^^^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:245:17
|
245 | None => 24, //~ ERROR match arms have same body
| ^^
|
--> $DIR/copies.rs:245:17
|
LL | None => 24, //~ ERROR match arms have same body
| ^^
|
note: same as this
--> $DIR/copies.rs:244:20
|
244 | Some(_) => 24,
| ^^
--> $DIR/copies.rs:244:20
|
LL | Some(_) => 24,
| ^^
note: consider refactoring into `Some(_) | None`
--> $DIR/copies.rs:244:20
|
244 | Some(_) => 24,
| ^^
--> $DIR/copies.rs:244:20
|
LL | Some(_) => 24,
| ^^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:267:28
|
267 | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
--> $DIR/copies.rs:267:28
|
LL | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
note: same as this
--> $DIR/copies.rs:266:28
|
266 | (Some(a), None) => bar(a),
| ^^^^^^
--> $DIR/copies.rs:266:28
|
LL | (Some(a), None) => bar(a),
| ^^^^^^
note: consider refactoring into `(Some(a), None) | (None, Some(a))`
--> $DIR/copies.rs:266:28
|
266 | (Some(a), None) => bar(a),
| ^^^^^^
--> $DIR/copies.rs:266:28
|
LL | (Some(a), None) => bar(a),
| ^^^^^^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:273:26
|
273 | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
--> $DIR/copies.rs:273:26
|
LL | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
note: same as this
--> $DIR/copies.rs:272:26
|
272 | (Some(a), ..) => bar(a),
| ^^^^^^
--> $DIR/copies.rs:272:26
|
LL | (Some(a), ..) => bar(a),
| ^^^^^^
note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
--> $DIR/copies.rs:272:26
|
272 | (Some(a), ..) => bar(a),
| ^^^^^^
--> $DIR/copies.rs:272:26
|
LL | (Some(a), ..) => bar(a),
| ^^^^^^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:279:20
|
279 | (.., 3) => 42, //~ ERROR match arms have same body
| ^^
|
--> $DIR/copies.rs:279:20
|
LL | (.., 3) => 42, //~ ERROR match arms have same body
| ^^
|
note: same as this
--> $DIR/copies.rs:278:23
|
278 | (1, .., 3) => 42,
| ^^
--> $DIR/copies.rs:278:23
|
LL | (1, .., 3) => 42,
| ^^
note: consider refactoring into `(1, .., 3) | (.., 3)`
--> $DIR/copies.rs:278:23
|
278 | (1, .., 3) => 42,
| ^^
--> $DIR/copies.rs:278:23
|
LL | (1, .., 3) => 42,
| ^^
error: this `if` has identical blocks
--> $DIR/copies.rs:285:12
|
285 | } else {
| ____________^
286 | | //~ ERROR same body as `if` block
287 | | 0.0
288 | | };
| |_____^
|
--> $DIR/copies.rs:285:12
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | 0.0
LL | | };
| |_____^
|
note: same as this
--> $DIR/copies.rs:283:21
|
283 | let _ = if true {
| _____________________^
284 | | 0.0
285 | | } else {
| |_____^
--> $DIR/copies.rs:283:21
|
LL | let _ = if true {
| _____________________^
LL | | 0.0
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:292:12
|
292 | } else {
| ____________^
293 | | //~ ERROR same body as `if` block
294 | | -0.0
295 | | };
| |_____^
|
--> $DIR/copies.rs:292:12
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | -0.0
LL | | };
| |_____^
|
note: same as this
--> $DIR/copies.rs:290:21
|
290 | let _ = if true {
| _____________________^
291 | | -0.0
292 | | } else {
| |_____^
--> $DIR/copies.rs:290:21
|
LL | let _ = if true {
| _____________________^
LL | | -0.0
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:305:12
|
305 | } else {
| ____________^
306 | | //~ ERROR same body as `if` block
307 | | std::f32::NAN
308 | | };
| |_____^
|
--> $DIR/copies.rs:305:12
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | std::f32::NAN
LL | | };
| |_____^
|
note: same as this
--> $DIR/copies.rs:303:21
|
303 | let _ = if true {
| _____________________^
304 | | std::f32::NAN
305 | | } else {
| |_____^
--> $DIR/copies.rs:303:21
|
LL | let _ = if true {
| _____________________^
LL | | std::f32::NAN
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:323:12
|
323 | } else {
| ____________^
324 | | //~ ERROR same body as `if` block
325 | | try!(Ok("foo"));
326 | | }
| |_____^
|
--> $DIR/copies.rs:323:12
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | try!(Ok("foo"));
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:321:13
|
321 | if true {
| _____________^
322 | | try!(Ok("foo"));
323 | | } else {
| |_____^
--> $DIR/copies.rs:321:13
|
LL | if true {
| _____________^
LL | | try!(Ok("foo"));
LL | | } else {
| |_____^
error: this `if` has the same condition as a previous if
--> $DIR/copies.rs:347:15
|
347 | } else if b {
| ^
|
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
--> $DIR/copies.rs:347:15
|
LL | } else if b {
| ^
|
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
note: same as this
--> $DIR/copies.rs:346:8
|
346 | if b {
| ^
--> $DIR/copies.rs:346:8
|
LL | if b {
| ^
error: this `if` has the same condition as a previous if
--> $DIR/copies.rs:352:15
|
352 | } else if a == 1 {
| ^^^^^^
|
--> $DIR/copies.rs:352:15
|
LL | } else if a == 1 {
| ^^^^^^
|
note: same as this
--> $DIR/copies.rs:351:8
|
351 | if a == 1 {
| ^^^^^^
--> $DIR/copies.rs:351:8
|
LL | if a == 1 {
| ^^^^^^
error: this `if` has the same condition as a previous if
--> $DIR/copies.rs:358:15
|
358 | } else if 2 * a == 1 {
| ^^^^^^^^^^
|
--> $DIR/copies.rs:358:15
|
LL | } else if 2 * a == 1 {
| ^^^^^^^^^^
|
note: same as this
--> $DIR/copies.rs:356:8
|
356 | if 2 * a == 1 {
| ^^^^^^^^^^
--> $DIR/copies.rs:356:8
|
LL | if 2 * a == 1 {
| ^^^^^^^^^^
error: aborting due to 20 previous errors

View File

@ -1,13 +1,13 @@
error: you are implementing `Iterator` on a `Copy` type
--> $DIR/copy_iterator.rs:15:1
|
15 | / impl Iterator for Countdown {
16 | | type Item = u8;
17 | |
18 | | fn next(&mut self) -> Option<u8> {
LL | / impl Iterator for Countdown {
LL | | type Item = u8;
LL | |
LL | | fn next(&mut self) -> Option<u8> {
... |
23 | | }
24 | | }
LL | | }
LL | | }
| |_^
|
= note: `-D clippy::copy-iterator` implied by `-D warnings`

View File

@ -1,7 +1,7 @@
error: you are getting the inner pointer of a temporary `CString`
--> $DIR/cstring.rs:16:5
|
16 | CString::new("foo").unwrap().as_ptr();
LL | CString::new("foo").unwrap().as_ptr();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(clippy::temporary_cstring_as_ptr)] on by default
@ -9,7 +9,7 @@ error: you are getting the inner pointer of a temporary `CString`
help: assign the `CString` to a variable to extend its lifetime
--> $DIR/cstring.rs:16:5
|
16 | CString::new("foo").unwrap().as_ptr();
LL | CString::new("foo").unwrap().as_ptr();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -1,272 +1,272 @@
error: the function has a cyclomatic complexity of 28
--> $DIR/cyclomatic_complexity.rs:15:1
|
15 | / fn main() {
16 | | if true {
17 | | println!("a");
18 | | }
LL | / fn main() {
LL | | if true {
LL | | println!("a");
LL | | }
... |
96 | | }
97 | | }
LL | | }
LL | | }
| |_^
|
= note: `-D clippy::cyclomatic-complexity` implied by `-D warnings`
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 7
--> $DIR/cyclomatic_complexity.rs:100:1
|
100 | / fn kaboom() {
101 | | let n = 0;
102 | | 'a: for i in 0..20 {
103 | | 'b: for j in i..20 {
... |
118 | | }
119 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:100:1
|
LL | / fn kaboom() {
LL | | let n = 0;
LL | | 'a: for i in 0..20 {
LL | | 'b: for j in i..20 {
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:146:1
|
146 | / fn lots_of_short_circuits() -> bool {
147 | | true && false && true && false && true && false && true
148 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:146:1
|
LL | / fn lots_of_short_circuits() -> bool {
LL | | true && false && true && false && true && false && true
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:151:1
|
151 | / fn lots_of_short_circuits2() -> bool {
152 | | true || false || true || false || true || false || true
153 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:151:1
|
LL | / fn lots_of_short_circuits2() -> bool {
LL | | true || false || true || false || true || false || true
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:156:1
|
156 | / fn baa() {
157 | | let x = || match 99 {
158 | | 0 => 0,
159 | | 1 => 1,
... |
170 | | }
171 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:156:1
|
LL | / fn baa() {
LL | | let x = || match 99 {
LL | | 0 => 0,
LL | | 1 => 1,
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:157:13
|
157 | let x = || match 99 {
| _____________^
158 | | 0 => 0,
159 | | 1 => 1,
160 | | 2 => 2,
... |
164 | | _ => 42,
165 | | };
| |_____^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:157:13
|
LL | let x = || match 99 {
| _____________^
LL | | 0 => 0,
LL | | 1 => 1,
LL | | 2 => 2,
... |
LL | | _ => 42,
LL | | };
| |_____^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:174:1
|
174 | / fn bar() {
175 | | match 99 {
176 | | 0 => println!("hi"),
177 | | _ => println!("bye"),
178 | | }
179 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:174:1
|
LL | / fn bar() {
LL | | match 99 {
LL | | 0 => println!("hi"),
LL | | _ => println!("bye"),
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:193:1
|
193 | / fn barr() {
194 | | match 99 {
195 | | 0 => println!("hi"),
196 | | 1 => println!("bla"),
... |
199 | | }
200 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:193:1
|
LL | / fn barr() {
LL | | match 99 {
LL | | 0 => println!("hi"),
LL | | 1 => println!("bla"),
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 3
--> $DIR/cyclomatic_complexity.rs:203:1
|
203 | / fn barr2() {
204 | | match 99 {
205 | | 0 => println!("hi"),
206 | | 1 => println!("bla"),
... |
215 | | }
216 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:203:1
|
LL | / fn barr2() {
LL | | match 99 {
LL | | 0 => println!("hi"),
LL | | 1 => println!("bla"),
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:219:1
|
219 | / fn barrr() {
220 | | match 99 {
221 | | 0 => println!("hi"),
222 | | 1 => panic!("bla"),
... |
225 | | }
226 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:219:1
|
LL | / fn barrr() {
LL | | match 99 {
LL | | 0 => println!("hi"),
LL | | 1 => panic!("bla"),
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 3
--> $DIR/cyclomatic_complexity.rs:229:1
|
229 | / fn barrr2() {
230 | | match 99 {
231 | | 0 => println!("hi"),
232 | | 1 => panic!("bla"),
... |
241 | | }
242 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:229:1
|
LL | / fn barrr2() {
LL | | match 99 {
LL | | 0 => println!("hi"),
LL | | 1 => panic!("bla"),
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:245:1
|
245 | / fn barrrr() {
246 | | match 99 {
247 | | 0 => println!("hi"),
248 | | 1 => println!("bla"),
... |
251 | | }
252 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:245:1
|
LL | / fn barrrr() {
LL | | match 99 {
LL | | 0 => println!("hi"),
LL | | 1 => println!("bla"),
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 3
--> $DIR/cyclomatic_complexity.rs:255:1
|
255 | / fn barrrr2() {
256 | | match 99 {
257 | | 0 => println!("hi"),
258 | | 1 => println!("bla"),
... |
267 | | }
268 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:255:1
|
LL | / fn barrrr2() {
LL | | match 99 {
LL | | 0 => println!("hi"),
LL | | 1 => println!("bla"),
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:271:1
|
271 | / fn cake() {
272 | | if 4 == 5 {
273 | | println!("yea");
274 | | } else {
... |
277 | | println!("whee");
278 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:271:1
|
LL | / fn cake() {
LL | | if 4 == 5 {
LL | | println!("yea");
LL | | } else {
... |
LL | | println!("whee");
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 4
--> $DIR/cyclomatic_complexity.rs:281:1
|
281 | / pub fn read_file(input_path: &str) -> String {
282 | | use std::fs::File;
283 | | use std::io::{Read, Write};
284 | | use std::path::Path;
... |
306 | | }
307 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:281:1
|
LL | / pub fn read_file(input_path: &str) -> String {
LL | | use std::fs::File;
LL | | use std::io::{Read, Write};
LL | | use std::path::Path;
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:312:1
|
312 | / fn void(void: Void) {
313 | | if true {
314 | | match void {}
315 | | }
316 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:312:1
|
LL | / fn void(void: Void) {
LL | | if true {
LL | | match void {}
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:325:1
|
325 | / fn try() -> Result<i32, &'static str> {
326 | | match 5 {
327 | | 5 => Ok(5),
328 | | _ => return Err("bla"),
329 | | }
330 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:325:1
|
LL | / fn try() -> Result<i32, &'static str> {
LL | | match 5 {
LL | | 5 => Ok(5),
LL | | _ => return Err("bla"),
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:333:1
|
333 | / fn try_again() -> Result<i32, &'static str> {
334 | | let _ = try!(Ok(42));
335 | | let _ = try!(Ok(43));
336 | | let _ = try!(Ok(44));
... |
345 | | }
346 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:333:1
|
LL | / fn try_again() -> Result<i32, &'static str> {
LL | | let _ = try!(Ok(42));
LL | | let _ = try!(Ok(43));
LL | | let _ = try!(Ok(44));
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:349:1
|
349 | / fn early() -> Result<i32, &'static str> {
350 | | return Ok(5);
351 | | return Ok(5);
352 | | return Ok(5);
... |
358 | | return Ok(5);
359 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:349:1
|
LL | / fn early() -> Result<i32, &'static str> {
LL | | return Ok(5);
LL | | return Ok(5);
LL | | return Ok(5);
... |
LL | | return Ok(5);
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 8
--> $DIR/cyclomatic_complexity.rs:363:1
|
363 | / fn early_ret() -> i32 {
364 | | let a = if true { 42 } else { return 0; };
365 | | let a = if a < 99 { 42 } else { return 0; };
366 | | let a = if a < 99 { 42 } else { return 0; };
... |
379 | | }
380 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
--> $DIR/cyclomatic_complexity.rs:363:1
|
LL | / fn early_ret() -> i32 {
LL | | let a = if true { 42 } else { return 0; };
LL | | let a = if a < 99 { 42 } else { return 0; };
LL | | let a = if a < 99 { 42 } else { return 0; };
... |
LL | | }
LL | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: aborting due to 20 previous errors

View File

@ -1,13 +1,13 @@
error: the function has a cyclomatic complexity of 3
--> $DIR/cyclomatic_complexity_attr_used.rs:18:1
|
18 | / fn kaboom() {
19 | | if 42 == 43 {
20 | | panic!();
21 | | } else if "cake" == "lie" {
22 | | println!("what?");
23 | | }
24 | | }
LL | / fn kaboom() {
LL | | if 42 == 43 {
LL | | panic!();
LL | | } else if "cake" == "lie" {
LL | | println!("what?");
LL | | }
LL | | }
| |_^
|
= note: `-D clippy::cyclomatic-complexity` implied by `-D warnings`

View File

@ -1,7 +1,7 @@
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:25:9
|
25 | 32_773, // 0x8005
LL | 32_773, // 0x8005
| ^^^^^^ help: consider: `0x8005`
|
= note: `-D clippy::decimal-literal-representation` implied by `-D warnings`
@ -9,25 +9,25 @@ error: integer literal has a better hexadecimal representation
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:26:9
|
26 | 65_280, // 0xFF00
LL | 65_280, // 0xFF00
| ^^^^^^ help: consider: `0xFF00`
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:27:9
|
27 | 2_131_750_927, // 0x7F0F_F00F
LL | 2_131_750_927, // 0x7F0F_F00F
| ^^^^^^^^^^^^^ help: consider: `0x7F0F_F00F`
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:28:9
|
28 | 2_147_483_647, // 0x7FFF_FFFF
LL | 2_147_483_647, // 0x7FFF_FFFF
| ^^^^^^^^^^^^^ help: consider: `0x7FFF_FFFF`
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:29:9
|
29 | 4_042_322_160, // 0xF0F0_F0F0
LL | 4_042_322_160, // 0xF0F0_F0F0
| ^^^^^^^^^^^^^ help: consider: `0xF0F0_F0F0`
error: aborting due to 5 previous errors

View File

@ -1,7 +1,7 @@
error: Calling std::string::String::default() is more clear than this expression
--> $DIR/default_trait_access.rs:17:22
|
17 | let s1: String = Default::default();
LL | let s1: String = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
|
= note: `-D clippy::default-trait-access` implied by `-D warnings`
@ -9,43 +9,43 @@ error: Calling std::string::String::default() is more clear than this expression
error: Calling std::string::String::default() is more clear than this expression
--> $DIR/default_trait_access.rs:21:22
|
21 | let s3: String = D2::default();
LL | let s3: String = D2::default();
| ^^^^^^^^^^^^^ help: try: `std::string::String::default()`
error: Calling std::string::String::default() is more clear than this expression
--> $DIR/default_trait_access.rs:23:22
|
23 | let s4: String = std::default::Default::default();
LL | let s4: String = std::default::Default::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
error: Calling std::string::String::default() is more clear than this expression
--> $DIR/default_trait_access.rs:27:22
|
27 | let s6: String = default::Default::default();
LL | let s6: String = default::Default::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
error: Calling GenericDerivedDefault<std::string::String>::default() is more clear than this expression
--> $DIR/default_trait_access.rs:37:46
|
37 | let s11: GenericDerivedDefault<String> = Default::default();
LL | let s11: GenericDerivedDefault<String> = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `GenericDerivedDefault<std::string::String>::default()`
error: Calling TupleDerivedDefault::default() is more clear than this expression
--> $DIR/default_trait_access.rs:43:36
|
43 | let s14: TupleDerivedDefault = Default::default();
LL | let s14: TupleDerivedDefault = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `TupleDerivedDefault::default()`
error: Calling ArrayDerivedDefault::default() is more clear than this expression
--> $DIR/default_trait_access.rs:45:36
|
45 | let s15: ArrayDerivedDefault = Default::default();
LL | let s15: ArrayDerivedDefault = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `ArrayDerivedDefault::default()`
error: Calling TupleStructDerivedDefault::default() is more clear than this expression
--> $DIR/default_trait_access.rs:49:42
|
49 | let s17: TupleStructDerivedDefault = Default::default();
LL | let s17: TupleStructDerivedDefault = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `TupleStructDerivedDefault::default()`
error: aborting due to 8 previous errors

View File

@ -1,7 +1,7 @@
error: lint `str_to_string` has been removed: `using `str::to_string` is common even today and specialization will likely happen soon`
--> $DIR/deprecated.rs:10:8
|
10 | #[warn(str_to_string)]
LL | #[warn(str_to_string)]
| ^^^^^^^^^^^^^
|
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
@ -9,25 +9,25 @@ error: lint `str_to_string` has been removed: `using `str::to_string` is common
error: lint `string_to_string` has been removed: `using `string::to_string` is common even today and specialization will likely happen soon`
--> $DIR/deprecated.rs:11:8
|
11 | #[warn(string_to_string)]
LL | #[warn(string_to_string)]
| ^^^^^^^^^^^^^^^^
error: lint `unstable_as_slice` has been removed: ``Vec::as_slice` has been stabilized in 1.7`
--> $DIR/deprecated.rs:12:8
|
12 | #[warn(unstable_as_slice)]
LL | #[warn(unstable_as_slice)]
| ^^^^^^^^^^^^^^^^^
error: lint `unstable_as_mut_slice` has been removed: ``Vec::as_mut_slice` has been stabilized in 1.7`
--> $DIR/deprecated.rs:13:8
|
13 | #[warn(unstable_as_mut_slice)]
LL | #[warn(unstable_as_mut_slice)]
| ^^^^^^^^^^^^^^^^^^^^^
error: lint `misaligned_transmute` has been removed: `this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr`
--> $DIR/deprecated.rs:14:8
|
14 | #[warn(misaligned_transmute)]
LL | #[warn(misaligned_transmute)]
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 5 previous errors

View File

@ -1,130 +1,130 @@
error: you are deriving `Hash` but have implemented `PartialEq` explicitly
--> $DIR/derive.rs:25:10
|
25 | #[derive(Hash)]
LL | #[derive(Hash)]
| ^^^^
|
= note: #[deny(clippy::derive_hash_xor_eq)] on by default
note: `PartialEq` implemented here
--> $DIR/derive.rs:28:1
|
28 | / impl PartialEq for Bar {
29 | | fn eq(&self, _: &Bar) -> bool {
30 | | true
31 | | }
32 | | }
LL | / impl PartialEq for Bar {
LL | | fn eq(&self, _: &Bar) -> bool {
LL | | true
LL | | }
LL | | }
| |_^
error: you are deriving `Hash` but have implemented `PartialEq` explicitly
--> $DIR/derive.rs:34:10
|
34 | #[derive(Hash)]
LL | #[derive(Hash)]
| ^^^^
|
note: `PartialEq` implemented here
--> $DIR/derive.rs:37:1
|
37 | / impl PartialEq<Baz> for Baz {
38 | | fn eq(&self, _: &Baz) -> bool {
39 | | true
40 | | }
41 | | }
LL | / impl PartialEq<Baz> for Baz {
LL | | fn eq(&self, _: &Baz) -> bool {
LL | | true
LL | | }
LL | | }
| |_^
error: you are implementing `Hash` explicitly but have derived `PartialEq`
--> $DIR/derive.rs:46:1
|
46 | / impl Hash for Bah {
47 | | fn hash<H: Hasher>(&self, _: &mut H) {}
48 | | }
LL | / impl Hash for Bah {
LL | | fn hash<H: Hasher>(&self, _: &mut H) {}
LL | | }
| |_^
|
note: `PartialEq` implemented here
--> $DIR/derive.rs:43:10
|
43 | #[derive(PartialEq)]
LL | #[derive(PartialEq)]
| ^^^^^^^^^
error: you are implementing `Clone` explicitly on a `Copy` type
--> $DIR/derive.rs:53:1
|
53 | / impl Clone for Qux {
54 | | fn clone(&self) -> Self {
55 | | Qux
56 | | }
57 | | }
LL | / impl Clone for Qux {
LL | | fn clone(&self) -> Self {
LL | | Qux
LL | | }
LL | | }
| |_^
|
= note: `-D clippy::expl-impl-clone-on-copy` implied by `-D warnings`
note: consider deriving `Clone` or removing `Copy`
--> $DIR/derive.rs:53:1
|
53 | / impl Clone for Qux {
54 | | fn clone(&self) -> Self {
55 | | Qux
56 | | }
57 | | }
LL | / impl Clone for Qux {
LL | | fn clone(&self) -> Self {
LL | | Qux
LL | | }
LL | | }
| |_^
error: you are implementing `Clone` explicitly on a `Copy` type
--> $DIR/derive.rs:77:1
|
77 | / impl<'a> Clone for Lt<'a> {
78 | | fn clone(&self) -> Self {
79 | | unimplemented!()
80 | | }
81 | | }
LL | / impl<'a> Clone for Lt<'a> {
LL | | fn clone(&self) -> Self {
LL | | unimplemented!()
LL | | }
LL | | }
| |_^
|
note: consider deriving `Clone` or removing `Copy`
--> $DIR/derive.rs:77:1
|
77 | / impl<'a> Clone for Lt<'a> {
78 | | fn clone(&self) -> Self {
79 | | unimplemented!()
80 | | }
81 | | }
LL | / impl<'a> Clone for Lt<'a> {
LL | | fn clone(&self) -> Self {
LL | | unimplemented!()
LL | | }
LL | | }
| |_^
error: you are implementing `Clone` explicitly on a `Copy` type
--> $DIR/derive.rs:89:1
|
89 | / impl Clone for BigArray {
90 | | fn clone(&self) -> Self {
91 | | unimplemented!()
92 | | }
93 | | }
LL | / impl Clone for BigArray {
LL | | fn clone(&self) -> Self {
LL | | unimplemented!()
LL | | }
LL | | }
| |_^
|
note: consider deriving `Clone` or removing `Copy`
--> $DIR/derive.rs:89:1
|
89 | / impl Clone for BigArray {
90 | | fn clone(&self) -> Self {
91 | | unimplemented!()
92 | | }
93 | | }
LL | / impl Clone for BigArray {
LL | | fn clone(&self) -> Self {
LL | | unimplemented!()
LL | | }
LL | | }
| |_^
error: you are implementing `Clone` explicitly on a `Copy` type
--> $DIR/derive.rs:101:1
|
101 | / impl Clone for FnPtr {
102 | | fn clone(&self) -> Self {
103 | | unimplemented!()
104 | | }
105 | | }
| |_^
|
--> $DIR/derive.rs:101:1
|
LL | / impl Clone for FnPtr {
LL | | fn clone(&self) -> Self {
LL | | unimplemented!()
LL | | }
LL | | }
| |_^
|
note: consider deriving `Clone` or removing `Copy`
--> $DIR/derive.rs:101:1
|
101 | / impl Clone for FnPtr {
102 | | fn clone(&self) -> Self {
103 | | unimplemented!()
104 | | }
105 | | }
| |_^
--> $DIR/derive.rs:101:1
|
LL | / impl Clone for FnPtr {
LL | | fn clone(&self) -> Self {
LL | | unimplemented!()
LL | | }
LL | | }
| |_^
error: aborting due to 7 previous errors

View File

@ -1,7 +1,7 @@
error: sub-expression diverges
--> $DIR/diverging_sub_expression.rs:30:10
|
30 | b || diverge();
LL | b || diverge();
| ^^^^^^^^^
|
= note: `-D clippy::diverging-sub-expression` implied by `-D warnings`
@ -9,31 +9,31 @@ error: sub-expression diverges
error: sub-expression diverges
--> $DIR/diverging_sub_expression.rs:31:10
|
31 | b || A.foo();
LL | b || A.foo();
| ^^^^^^^
error: sub-expression diverges
--> $DIR/diverging_sub_expression.rs:40:26
|
40 | 6 => true || return,
LL | 6 => true || return,
| ^^^^^^
error: sub-expression diverges
--> $DIR/diverging_sub_expression.rs:41:26
|
41 | 7 => true || continue,
LL | 7 => true || continue,
| ^^^^^^^^
error: sub-expression diverges
--> $DIR/diverging_sub_expression.rs:44:26
|
44 | 3 => true || diverge(),
LL | 3 => true || diverge(),
| ^^^^^^^^^
error: sub-expression diverges
--> $DIR/diverging_sub_expression.rs:49:26
|
49 | _ => true || break,
LL | _ => true || break,
| ^^^^^
error: aborting due to 6 previous errors

View File

@ -1,7 +1,7 @@
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
--> $DIR/dlist.rs:19:16
|
19 | type Baz = LinkedList<u8>;
LL | type Baz = LinkedList<u8>;
| ^^^^^^^^^^^^^^
|
= note: `-D clippy::linkedlist` implied by `-D warnings`
@ -10,7 +10,7 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
--> $DIR/dlist.rs:20:12
|
20 | fn foo(LinkedList<u8>);
LL | fn foo(LinkedList<u8>);
| ^^^^^^^^^^^^^^
|
= help: a VecDeque might work
@ -18,7 +18,7 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
--> $DIR/dlist.rs:21:23
|
21 | const BAR: Option<LinkedList<u8>>;
LL | const BAR: Option<LinkedList<u8>>;
| ^^^^^^^^^^^^^^
|
= help: a VecDeque might work
@ -26,7 +26,7 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
--> $DIR/dlist.rs:32:15
|
32 | fn foo(_: LinkedList<u8>) {}
LL | fn foo(_: LinkedList<u8>) {}
| ^^^^^^^^^^^^^^
|
= help: a VecDeque might work
@ -34,7 +34,7 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
--> $DIR/dlist.rs:35:39
|
35 | pub fn test(my_favourite_linked_list: LinkedList<u8>) {
LL | pub fn test(my_favourite_linked_list: LinkedList<u8>) {
| ^^^^^^^^^^^^^^
|
= help: a VecDeque might work
@ -42,7 +42,7 @@ error: I see you're using a LinkedList! Perhaps you meant some other data struct
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
--> $DIR/dlist.rs:39:29
|
39 | pub fn test_ret() -> Option<LinkedList<u8>> {
LL | pub fn test_ret() -> Option<LinkedList<u8>> {
| ^^^^^^^^^^^^^^
|
= help: a VecDeque might work

View File

@ -1,7 +1,7 @@
error: you should put `DOC_MARKDOWN` between ticks in the documentation
--> $DIR/doc.rs:10:29
|
10 | //! This file tests for the DOC_MARKDOWN lint
LL | //! This file tests for the DOC_MARKDOWN lint
| ^^^^^^^^^^^^
|
= note: `-D clippy::doc-markdown` implied by `-D warnings`
@ -9,182 +9,182 @@ error: you should put `DOC_MARKDOWN` between ticks in the documentation
error: you should put `foo_bar` between ticks in the documentation
--> $DIR/doc.rs:15:9
|
15 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
LL | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
| ^^^^^^^
error: you should put `foo::bar` between ticks in the documentation
--> $DIR/doc.rs:15:51
|
15 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
LL | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
| ^^^^^^^^
error: you should put `Foo::some_fun` between ticks in the documentation
--> $DIR/doc.rs:16:84
|
16 | /// Markdown is _weird_. I mean _really weird_. This /_ is ok. So is `_`. But not Foo::some_fun
LL | /// Markdown is _weird_. I mean _really weird_. This /_ is ok. So is `_`. But not Foo::some_fun
| ^^^^^^^^^^^^^
error: you should put `a::global:path` between ticks in the documentation
--> $DIR/doc.rs:18:15
|
18 | /// Here be ::a::global:path.
LL | /// Here be ::a::global:path.
| ^^^^^^^^^^^^^^
error: you should put `NotInCodeBlock` between ticks in the documentation
--> $DIR/doc.rs:19:22
|
19 | /// That's not code ~NotInCodeBlock~.
LL | /// That's not code ~NotInCodeBlock~.
| ^^^^^^^^^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:20:5
|
20 | /// be_sure_we_got_to_the_end_of_it
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:34:5
|
34 | /// be_sure_we_got_to_the_end_of_it
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:41:5
|
41 | /// be_sure_we_got_to_the_end_of_it
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:55:5
|
55 | /// be_sure_we_got_to_the_end_of_it
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `link_with_underscores` between ticks in the documentation
--> $DIR/doc.rs:59:22
|
59 | /// This test has [a link_with_underscores][chunked-example] inside it. See #823.
LL | /// This test has [a link_with_underscores][chunked-example] inside it. See #823.
| ^^^^^^^^^^^^^^^^^^^^^
error: you should put `inline_link2` between ticks in the documentation
--> $DIR/doc.rs:62:21
|
62 | /// It can also be [inline_link2].
LL | /// It can also be [inline_link2].
| ^^^^^^^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:72:5
|
72 | /// be_sure_we_got_to_the_end_of_it
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `CamelCaseThing` between ticks in the documentation
--> $DIR/doc.rs:80:8
|
80 | /// ## CamelCaseThing
LL | /// ## CamelCaseThing
| ^^^^^^^^^^^^^^
error: you should put `CamelCaseThing` between ticks in the documentation
--> $DIR/doc.rs:83:7
|
83 | /// # CamelCaseThing
LL | /// # CamelCaseThing
| ^^^^^^^^^^^^^^
error: you should put `CamelCaseThing` between ticks in the documentation
--> $DIR/doc.rs:85:22
|
85 | /// Not a title #897 CamelCaseThing
LL | /// Not a title #897 CamelCaseThing
| ^^^^^^^^^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:86:5
|
86 | /// be_sure_we_got_to_the_end_of_it
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:93:5
|
93 | /// be_sure_we_got_to_the_end_of_it
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:106:5
|
106 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--> $DIR/doc.rs:106:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `FooBar` between ticks in the documentation
--> $DIR/doc.rs:117:42
|
117 | /** E.g. serialization of an empty list: FooBar
| ^^^^^^
--> $DIR/doc.rs:117:42
|
LL | /** E.g. serialization of an empty list: FooBar
| ^^^^^^
error: you should put `BarQuz` between ticks in the documentation
--> $DIR/doc.rs:122:5
|
122 | And BarQuz too.
| ^^^^^^
--> $DIR/doc.rs:122:5
|
LL | And BarQuz too.
| ^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:123:1
|
123 | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--> $DIR/doc.rs:123:1
|
LL | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `FooBar` between ticks in the documentation
--> $DIR/doc.rs:128:42
|
128 | /** E.g. serialization of an empty list: FooBar
| ^^^^^^
--> $DIR/doc.rs:128:42
|
LL | /** E.g. serialization of an empty list: FooBar
| ^^^^^^
error: you should put `BarQuz` between ticks in the documentation
--> $DIR/doc.rs:133:5
|
133 | And BarQuz too.
| ^^^^^^
--> $DIR/doc.rs:133:5
|
LL | And BarQuz too.
| ^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:134:1
|
134 | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--> $DIR/doc.rs:134:1
|
LL | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:145:5
|
145 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--> $DIR/doc.rs:145:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> $DIR/doc.rs:172:13
|
172 | /// Not ok: http://www.unicode.org
| ^^^^^^^^^^^^^^^^^^^^^^
--> $DIR/doc.rs:172:13
|
LL | /// Not ok: http://www.unicode.org
| ^^^^^^^^^^^^^^^^^^^^^^
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> $DIR/doc.rs:173:13
|
173 | /// Not ok: https://www.unicode.org
| ^^^^^^^^^^^^^^^^^^^^^^^
--> $DIR/doc.rs:173:13
|
LL | /// Not ok: https://www.unicode.org
| ^^^^^^^^^^^^^^^^^^^^^^^
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> $DIR/doc.rs:174:13
|
174 | /// Not ok: http://www.unicode.org/
| ^^^^^^^^^^^^^^^^^^^^^^
--> $DIR/doc.rs:174:13
|
LL | /// Not ok: http://www.unicode.org/
| ^^^^^^^^^^^^^^^^^^^^^^
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> $DIR/doc.rs:175:13
|
175 | /// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--> $DIR/doc.rs:175:13
|
LL | /// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you should put `mycrate::Collection` between ticks in the documentation
--> $DIR/doc.rs:181:22
|
181 | /// An iterator over mycrate::Collection's values.
| ^^^^^^^^^^^^^^^^^^^
--> $DIR/doc.rs:181:22
|
LL | /// An iterator over mycrate::Collection's values.
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to 31 previous errors

View File

@ -1,7 +1,7 @@
error: This binary expression can be simplified
--> $DIR/double_comparison.rs:13:8
|
13 | if x == y || x < y {
LL | if x == y || x < y {
| ^^^^^^^^^^^^^^^ help: try: `x <= y`
|
= note: `-D clippy::double-comparisons` implied by `-D warnings`
@ -9,43 +9,43 @@ error: This binary expression can be simplified
error: This binary expression can be simplified
--> $DIR/double_comparison.rs:16:8
|
16 | if x < y || x == y {
LL | if x < y || x == y {
| ^^^^^^^^^^^^^^^ help: try: `x <= y`
error: This binary expression can be simplified
--> $DIR/double_comparison.rs:19:8
|
19 | if x == y || x > y {
LL | if x == y || x > y {
| ^^^^^^^^^^^^^^^ help: try: `x >= y`
error: This binary expression can be simplified
--> $DIR/double_comparison.rs:22:8
|
22 | if x > y || x == y {
LL | if x > y || x == y {
| ^^^^^^^^^^^^^^^ help: try: `x >= y`
error: This binary expression can be simplified
--> $DIR/double_comparison.rs:25:8
|
25 | if x < y || x > y {
LL | if x < y || x > y {
| ^^^^^^^^^^^^^^ help: try: `x != y`
error: This binary expression can be simplified
--> $DIR/double_comparison.rs:28:8
|
28 | if x > y || x < y {
LL | if x > y || x < y {
| ^^^^^^^^^^^^^^ help: try: `x != y`
error: This binary expression can be simplified
--> $DIR/double_comparison.rs:31:8
|
31 | if x <= y && x >= y {
LL | if x <= y && x >= y {
| ^^^^^^^^^^^^^^^^ help: try: `x == y`
error: This binary expression can be simplified
--> $DIR/double_comparison.rs:34:8
|
34 | if x >= y && x <= y {
LL | if x >= y && x <= y {
| ^^^^^^^^^^^^^^^^ help: try: `x == y`
error: aborting due to 8 previous errors

View File

@ -1,7 +1,7 @@
error: `--x` could be misinterpreted as pre-decrement by C programmers, is usually a no-op
--> $DIR/double_neg.rs:15:5
|
15 | --x;
LL | --x;
| ^^^
|
= note: `-D clippy::double-neg` implied by `-D warnings`

View File

@ -1,7 +1,7 @@
error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:21:5
|
21 | ((0))
LL | ((0))
| ^^^^^
|
= note: `-D clippy::double-parens` implied by `-D warnings`
@ -9,31 +9,31 @@ error: Consider removing unnecessary double parentheses
error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:25:14
|
25 | dummy_fn((0));
LL | dummy_fn((0));
| ^^^
error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:29:20
|
29 | x.dummy_method((0));
LL | x.dummy_method((0));
| ^^^
error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:33:5
|
33 | ((1, 2))
LL | ((1, 2))
| ^^^^^^^^
error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:37:5
|
37 | (())
LL | (())
| ^^^^
error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:59:16
|
59 | assert_eq!(((1, 2)), (1, 2), "Error");
LL | assert_eq!(((1, 2)), (1, 2), "Error");
| ^^^^^^^^
error: aborting due to 6 previous errors

View File

@ -1,75 +1,75 @@
error: calls to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
--> $DIR/drop_forget_copy.rs:42:5
|
42 | drop(s1);
LL | drop(s1);
| ^^^^^^^^
|
= note: `-D clippy::drop-copy` implied by `-D warnings`
note: argument has type SomeStruct
--> $DIR/drop_forget_copy.rs:42:10
|
42 | drop(s1);
LL | drop(s1);
| ^^
error: calls to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
--> $DIR/drop_forget_copy.rs:43:5
|
43 | drop(s2);
LL | drop(s2);
| ^^^^^^^^
|
note: argument has type SomeStruct
--> $DIR/drop_forget_copy.rs:43:10
|
43 | drop(s2);
LL | drop(s2);
| ^^
error: calls to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
--> $DIR/drop_forget_copy.rs:45:5
|
45 | drop(s4);
LL | drop(s4);
| ^^^^^^^^
|
note: argument has type SomeStruct
--> $DIR/drop_forget_copy.rs:45:10
|
45 | drop(s4);
LL | drop(s4);
| ^^
error: calls to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
--> $DIR/drop_forget_copy.rs:48:5
|
48 | forget(s1);
LL | forget(s1);
| ^^^^^^^^^^
|
= note: `-D clippy::forget-copy` implied by `-D warnings`
note: argument has type SomeStruct
--> $DIR/drop_forget_copy.rs:48:12
|
48 | forget(s1);
LL | forget(s1);
| ^^
error: calls to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
--> $DIR/drop_forget_copy.rs:49:5
|
49 | forget(s2);
LL | forget(s2);
| ^^^^^^^^^^
|
note: argument has type SomeStruct
--> $DIR/drop_forget_copy.rs:49:12
|
49 | forget(s2);
LL | forget(s2);
| ^^
error: calls to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
--> $DIR/drop_forget_copy.rs:51:5
|
51 | forget(s4);
LL | forget(s4);
| ^^^^^^^^^^
|
note: argument has type SomeStruct
--> $DIR/drop_forget_copy.rs:51:12
|
51 | forget(s4);
LL | forget(s4);
| ^^
error: aborting due to 6 previous errors

View File

@ -1,219 +1,219 @@
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
--> $DIR/drop_forget_ref.rs:18:5
|
18 | drop(&SomeStruct);
LL | drop(&SomeStruct);
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::drop-ref` implied by `-D warnings`
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:18:10
|
18 | drop(&SomeStruct);
LL | drop(&SomeStruct);
| ^^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
--> $DIR/drop_forget_ref.rs:19:5
|
19 | forget(&SomeStruct);
LL | forget(&SomeStruct);
| ^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::forget-ref` implied by `-D warnings`
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:19:12
|
19 | forget(&SomeStruct);
LL | forget(&SomeStruct);
| ^^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
--> $DIR/drop_forget_ref.rs:22:5
|
22 | drop(&owned1);
LL | drop(&owned1);
| ^^^^^^^^^^^^^
|
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:22:10
|
22 | drop(&owned1);
LL | drop(&owned1);
| ^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
--> $DIR/drop_forget_ref.rs:23:5
|
23 | drop(&&owned1);
LL | drop(&&owned1);
| ^^^^^^^^^^^^^^
|
note: argument has type &&SomeStruct
--> $DIR/drop_forget_ref.rs:23:10
|
23 | drop(&&owned1);
LL | drop(&&owned1);
| ^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
--> $DIR/drop_forget_ref.rs:24:5
|
24 | drop(&mut owned1);
LL | drop(&mut owned1);
| ^^^^^^^^^^^^^^^^^
|
note: argument has type &mut SomeStruct
--> $DIR/drop_forget_ref.rs:24:10
|
24 | drop(&mut owned1);
LL | drop(&mut owned1);
| ^^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
--> $DIR/drop_forget_ref.rs:27:5
|
27 | forget(&owned2);
LL | forget(&owned2);
| ^^^^^^^^^^^^^^^
|
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:27:12
|
27 | forget(&owned2);
LL | forget(&owned2);
| ^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
--> $DIR/drop_forget_ref.rs:28:5
|
28 | forget(&&owned2);
LL | forget(&&owned2);
| ^^^^^^^^^^^^^^^^
|
note: argument has type &&SomeStruct
--> $DIR/drop_forget_ref.rs:28:12
|
28 | forget(&&owned2);
LL | forget(&&owned2);
| ^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
--> $DIR/drop_forget_ref.rs:29:5
|
29 | forget(&mut owned2);
LL | forget(&mut owned2);
| ^^^^^^^^^^^^^^^^^^^
|
note: argument has type &mut SomeStruct
--> $DIR/drop_forget_ref.rs:29:12
|
29 | forget(&mut owned2);
LL | forget(&mut owned2);
| ^^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
--> $DIR/drop_forget_ref.rs:33:5
|
33 | drop(reference1);
LL | drop(reference1);
| ^^^^^^^^^^^^^^^^
|
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:33:10
|
33 | drop(reference1);
LL | drop(reference1);
| ^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
--> $DIR/drop_forget_ref.rs:34:5
|
34 | forget(&*reference1);
LL | forget(&*reference1);
| ^^^^^^^^^^^^^^^^^^^^
|
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:34:12
|
34 | forget(&*reference1);
LL | forget(&*reference1);
| ^^^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
--> $DIR/drop_forget_ref.rs:37:5
|
37 | drop(reference2);
LL | drop(reference2);
| ^^^^^^^^^^^^^^^^
|
note: argument has type &mut SomeStruct
--> $DIR/drop_forget_ref.rs:37:10
|
37 | drop(reference2);
LL | drop(reference2);
| ^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
--> $DIR/drop_forget_ref.rs:39:5
|
39 | forget(reference3);
LL | forget(reference3);
| ^^^^^^^^^^^^^^^^^^
|
note: argument has type &mut SomeStruct
--> $DIR/drop_forget_ref.rs:39:12
|
39 | forget(reference3);
LL | forget(reference3);
| ^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
--> $DIR/drop_forget_ref.rs:42:5
|
42 | drop(reference4);
LL | drop(reference4);
| ^^^^^^^^^^^^^^^^
|
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:42:10
|
42 | drop(reference4);
LL | drop(reference4);
| ^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
--> $DIR/drop_forget_ref.rs:43:5
|
43 | forget(reference4);
LL | forget(reference4);
| ^^^^^^^^^^^^^^^^^^
|
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:43:12
|
43 | forget(reference4);
LL | forget(reference4);
| ^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
--> $DIR/drop_forget_ref.rs:48:5
|
48 | drop(&val);
LL | drop(&val);
| ^^^^^^^^^^
|
note: argument has type &T
--> $DIR/drop_forget_ref.rs:48:10
|
48 | drop(&val);
LL | drop(&val);
| ^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
--> $DIR/drop_forget_ref.rs:54:5
|
54 | forget(&val);
LL | forget(&val);
| ^^^^^^^^^^^^
|
note: argument has type &T
--> $DIR/drop_forget_ref.rs:54:12
|
54 | forget(&val);
LL | forget(&val);
| ^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
--> $DIR/drop_forget_ref.rs:62:5
|
62 | std::mem::drop(&SomeStruct);
LL | std::mem::drop(&SomeStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:62:20
|
62 | std::mem::drop(&SomeStruct);
LL | std::mem::drop(&SomeStruct);
| ^^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
--> $DIR/drop_forget_ref.rs:65:5
|
65 | std::mem::forget(&SomeStruct);
LL | std::mem::forget(&SomeStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: argument has type &SomeStruct
--> $DIR/drop_forget_ref.rs:65:22
|
65 | std::mem::forget(&SomeStruct);
LL | std::mem::forget(&SomeStruct);
| ^^^^^^^^^^^
error: aborting due to 18 previous errors

View File

@ -1,7 +1,7 @@
error: `darth` already exists, having another argument having almost the same name makes code comprehension and documentation more difficult
--> $DIR/duplicate_underscore_argument.rs:13:23
|
13 | fn join_the_dark_side(darth: i32, _darth: i32) {}
LL | fn join_the_dark_side(darth: i32, _darth: i32) {}
| ^^^^^
|
= note: `-D clippy::duplicate-underscore-argument` implied by `-D warnings`

View File

@ -1,7 +1,7 @@
error: Calling `subsec_millis()` is more concise than this calculation
--> $DIR/duration_subsec.rs:17:24
|
17 | let bad_millis_1 = dur.subsec_micros() / 1_000;
LL | let bad_millis_1 = dur.subsec_micros() / 1_000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
|
= note: `-D clippy::duration-subsec` implied by `-D warnings`
@ -9,25 +9,25 @@ error: Calling `subsec_millis()` is more concise than this calculation
error: Calling `subsec_millis()` is more concise than this calculation
--> $DIR/duration_subsec.rs:18:24
|
18 | let bad_millis_2 = dur.subsec_nanos() / 1_000_000;
LL | let bad_millis_2 = dur.subsec_nanos() / 1_000_000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
error: Calling `subsec_micros()` is more concise than this calculation
--> $DIR/duration_subsec.rs:23:22
|
23 | let bad_micros = dur.subsec_nanos() / 1_000;
LL | let bad_micros = dur.subsec_nanos() / 1_000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_micros()`
error: Calling `subsec_micros()` is more concise than this calculation
--> $DIR/duration_subsec.rs:28:13
|
28 | let _ = (&dur).subsec_nanos() / 1_000;
LL | let _ = (&dur).subsec_nanos() / 1_000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&dur).subsec_micros()`
error: Calling `subsec_micros()` is more concise than this calculation
--> $DIR/duration_subsec.rs:32:13
|
32 | let _ = dur.subsec_nanos() / NANOS_IN_MICRO;
LL | let _ = dur.subsec_nanos() / NANOS_IN_MICRO;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_micros()`
error: aborting due to 5 previous errors

View File

@ -1,11 +1,11 @@
error: if expression with an `else if`, but without a final `else`
--> $DIR/else_if_without_else.rs:54:12
|
54 | } else if bla2() {
LL | } else if bla2() {
| ____________^
55 | | //~ ERROR else if without else
56 | | println!("else if");
57 | | }
LL | | //~ ERROR else if without else
LL | | println!("else if");
LL | | }
| |_____^
|
= note: `-D clippy::else-if-without-else` implied by `-D warnings`
@ -14,11 +14,11 @@ error: if expression with an `else if`, but without a final `else`
error: if expression with an `else if`, but without a final `else`
--> $DIR/else_if_without_else.rs:63:12
|
63 | } else if bla3() {
LL | } else if bla3() {
| ____________^
64 | | //~ ERROR else if without else
65 | | println!("else if 2");
66 | | }
LL | | //~ ERROR else if without else
LL | | println!("else if 2");
LL | | }
| |_____^
|
= help: add an `else` block here

View File

@ -1,14 +1,14 @@
error: enum with no variants
--> $DIR/empty_enum.rs:13:1
|
13 | enum Empty {}
LL | enum Empty {}
| ^^^^^^^^^^^^^
|
= note: `-D clippy::empty-enum` implied by `-D warnings`
help: consider using the uninhabited type `!` or a wrapper around it
--> $DIR/empty_enum.rs:13:1
|
13 | enum Empty {}
LL | enum Empty {}
| ^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -1,10 +1,10 @@
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:13:1
|
13 | / #[crate_type = "lib"]
14 | |
15 | | /// some comment
16 | | fn with_one_newline_and_comment() { assert!(true) }
LL | / #[crate_type = "lib"]
LL | |
LL | | /// some comment
LL | | fn with_one_newline_and_comment() { assert!(true) }
| |_
|
= note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
@ -12,42 +12,42 @@ error: Found an empty line after an outer attribute. Perhaps you forgot to add a
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:25:1
|
25 | / #[crate_type = "lib"]
26 | |
27 | | fn with_one_newline() { assert!(true) }
LL | / #[crate_type = "lib"]
LL | |
LL | | fn with_one_newline() { assert!(true) }
| |_
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:30:1
|
30 | / #[crate_type = "lib"]
31 | |
32 | |
33 | | fn with_two_newlines() { assert!(true) }
LL | / #[crate_type = "lib"]
LL | |
LL | |
LL | | fn with_two_newlines() { assert!(true) }
| |_
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:37:1
|
37 | / #[crate_type = "lib"]
38 | |
39 | | enum Baz {
LL | / #[crate_type = "lib"]
LL | |
LL | | enum Baz {
| |_
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:45:1
|
45 | / #[crate_type = "lib"]
46 | |
47 | | struct Foo {
LL | / #[crate_type = "lib"]
LL | |
LL | | struct Foo {
| |_
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:53:1
|
53 | / #[crate_type = "lib"]
54 | |
55 | | mod foo {
LL | / #[crate_type = "lib"]
LL | |
LL | | mod foo {
| |_
error: aborting due to 6 previous errors

View File

@ -1,9 +1,9 @@
error: usage of `contains_key` followed by `insert` on a `HashMap`
--> $DIR/entry.rs:19:5
|
19 | / if !m.contains_key(&k) {
20 | | m.insert(k, v);
21 | | }
LL | / if !m.contains_key(&k) {
LL | | m.insert(k, v);
LL | | }
| |_____^ help: consider using: `m.entry(k).or_insert(v)`
|
= note: `-D clippy::map-entry` implied by `-D warnings`
@ -11,63 +11,63 @@ error: usage of `contains_key` followed by `insert` on a `HashMap`
error: usage of `contains_key` followed by `insert` on a `HashMap`
--> $DIR/entry.rs:25:5
|
25 | / if !m.contains_key(&k) {
26 | | foo();
27 | | m.insert(k, v);
28 | | }
LL | / if !m.contains_key(&k) {
LL | | foo();
LL | | m.insert(k, v);
LL | | }
| |_____^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `HashMap`
--> $DIR/entry.rs:32:5
|
32 | / if !m.contains_key(&k) {
33 | | m.insert(k, v)
34 | | } else {
35 | | None
36 | | };
LL | / if !m.contains_key(&k) {
LL | | m.insert(k, v)
LL | | } else {
LL | | None
LL | | };
| |_____^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `HashMap`
--> $DIR/entry.rs:40:5
|
40 | / if m.contains_key(&k) {
41 | | None
42 | | } else {
43 | | m.insert(k, v)
44 | | };
LL | / if m.contains_key(&k) {
LL | | None
LL | | } else {
LL | | m.insert(k, v)
LL | | };
| |_____^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `HashMap`
--> $DIR/entry.rs:48:5
|
48 | / if !m.contains_key(&k) {
49 | | foo();
50 | | m.insert(k, v)
51 | | } else {
52 | | None
53 | | };
LL | / if !m.contains_key(&k) {
LL | | foo();
LL | | m.insert(k, v)
LL | | } else {
LL | | None
LL | | };
| |_____^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `HashMap`
--> $DIR/entry.rs:57:5
|
57 | / if m.contains_key(&k) {
58 | | None
59 | | } else {
60 | | foo();
61 | | m.insert(k, v)
62 | | };
LL | / if m.contains_key(&k) {
LL | | None
LL | | } else {
LL | | foo();
LL | | m.insert(k, v)
LL | | };
| |_____^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `BTreeMap`
--> $DIR/entry.rs:66:5
|
66 | / if !m.contains_key(&k) {
67 | | foo();
68 | | m.insert(k, v)
69 | | } else {
70 | | None
71 | | };
LL | / if !m.contains_key(&k) {
LL | | foo();
LL | | m.insert(k, v)
LL | | } else {
LL | | None
LL | | };
| |_____^ help: consider using: `m.entry(k)`
error: aborting due to 7 previous errors

View File

@ -1,7 +1,7 @@
error: don't use glob imports for enum variants
--> $DIR/enum_glob_use.rs:13:1
|
13 | use std::cmp::Ordering::*;
LL | use std::cmp::Ordering::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::enum-glob-use` implied by `-D warnings`
@ -9,7 +9,7 @@ error: don't use glob imports for enum variants
error: don't use glob imports for enum variants
--> $DIR/enum_glob_use.rs:19:1
|
19 | use self::Enum::*;
LL | use self::Enum::*;
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -1,7 +1,7 @@
error: Variant name ends with the enum's name
--> $DIR/enum_variants.rs:25:5
|
25 | cFoo,
LL | cFoo,
| ^^^^
|
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
@ -9,29 +9,29 @@ error: Variant name ends with the enum's name
error: Variant name starts with the enum's name
--> $DIR/enum_variants.rs:36:5
|
36 | FoodGood,
LL | FoodGood,
| ^^^^^^^^
error: Variant name starts with the enum's name
--> $DIR/enum_variants.rs:37:5
|
37 | FoodMiddle,
LL | FoodMiddle,
| ^^^^^^^^^^
error: Variant name starts with the enum's name
--> $DIR/enum_variants.rs:38:5
|
38 | FoodBad,
LL | FoodBad,
| ^^^^^^^
error: All variants have the same prefix: `Food`
--> $DIR/enum_variants.rs:35:1
|
35 | / enum Food {
36 | | FoodGood,
37 | | FoodMiddle,
38 | | FoodBad,
39 | | }
LL | / enum Food {
LL | | FoodGood,
LL | | FoodMiddle,
LL | | FoodBad,
LL | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
@ -39,11 +39,11 @@ error: All variants have the same prefix: `Food`
error: All variants have the same prefix: `CallType`
--> $DIR/enum_variants.rs:45:1
|
45 | / enum BadCallType {
46 | | CallTypeCall,
47 | | CallTypeCreate,
48 | | CallTypeDestroy,
49 | | }
LL | / enum BadCallType {
LL | | CallTypeCall,
LL | | CallTypeCreate,
LL | | CallTypeDestroy,
LL | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
@ -51,11 +51,11 @@ error: All variants have the same prefix: `CallType`
error: All variants have the same prefix: `Constant`
--> $DIR/enum_variants.rs:57:1
|
57 | / enum Consts {
58 | | ConstantInt,
59 | | ConstantCake,
60 | | ConstantLie,
61 | | }
LL | / enum Consts {
LL | | ConstantInt,
LL | | ConstantCake,
LL | | ConstantLie,
LL | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
@ -63,39 +63,39 @@ error: All variants have the same prefix: `Constant`
error: All variants have the same prefix: `With`
--> $DIR/enum_variants.rs:91:1
|
91 | / enum Seallll {
92 | | WithOutCake,
93 | | WithOutTea,
94 | | WithOut,
95 | | }
LL | / enum Seallll {
LL | | WithOutCake,
LL | | WithOutTea,
LL | | WithOut,
LL | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
error: All variants have the same prefix: `Prefix`
--> $DIR/enum_variants.rs:97:1
|
97 | / enum NonCaps {
98 | | Prefix的,
99 | | PrefixTea,
100 | | PrefixCake,
101 | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
--> $DIR/enum_variants.rs:97:1
|
LL | / enum NonCaps {
LL | | Prefix的,
LL | | PrefixTea,
LL | | PrefixCake,
LL | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
error: All variants have the same prefix: `With`
--> $DIR/enum_variants.rs:103:1
|
103 | / pub enum PubSeall {
104 | | WithOutCake,
105 | | WithOutTea,
106 | | WithOut,
107 | | }
| |_^
|
= note: `-D clippy::pub-enum-variant-names` implied by `-D warnings`
= help: remove the prefixes and use full paths to the variants instead of glob imports
--> $DIR/enum_variants.rs:103:1
|
LL | / pub enum PubSeall {
LL | | WithOutCake,
LL | | WithOutTea,
LL | | WithOut,
LL | | }
| |_^
|
= note: `-D clippy::pub-enum-variant-names` implied by `-D warnings`
= help: remove the prefixes and use full paths to the variants instead of glob imports
error: aborting due to 10 previous errors

View File

@ -1,7 +1,7 @@
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:17:5
|
17 | X = 0x1_0000_0000,
LL | X = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::enum-clike-unportable-variant` implied by `-D warnings`
@ -9,43 +9,43 @@ error: Clike enum variant discriminant is not portable to 32-bit targets
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:24:5
|
24 | X = 0x1_0000_0000,
LL | X = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:27:5
|
27 | A = 0xFFFF_FFFF,
LL | A = 0xFFFF_FFFF,
| ^^^^^^^^^^^^^^^
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:34:5
|
34 | Z = 0xFFFF_FFFF,
LL | Z = 0xFFFF_FFFF,
| ^^^^^^^^^^^^^^^
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:35:5
|
35 | A = 0x1_0000_0000,
LL | A = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:37:5
|
37 | C = (std::i32::MIN as isize) - 1,
LL | C = (std::i32::MIN as isize) - 1,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:43:5
|
43 | Z = 0xFFFF_FFFF,
LL | Z = 0xFFFF_FFFF,
| ^^^^^^^^^^^^^^^
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:44:5
|
44 | A = 0x1_0000_0000,
LL | A = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^
error: aborting due to 8 previous errors

View File

@ -1,7 +1,7 @@
error: this boolean expression can be simplified
--> $DIR/eq_op.rs:44:5
|
44 | true && true;
LL | true && true;
| ^^^^^^^^^^^^ help: try: `true`
|
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
@ -9,37 +9,37 @@ error: this boolean expression can be simplified
error: this boolean expression can be simplified
--> $DIR/eq_op.rs:46:5
|
46 | true || true;
LL | true || true;
| ^^^^^^^^^^^^ help: try: `true`
error: this boolean expression can be simplified
--> $DIR/eq_op.rs:52:5
|
52 | a == b && b == a;
LL | a == b && b == a;
| ^^^^^^^^^^^^^^^^ help: try: `a == b`
error: this boolean expression can be simplified
--> $DIR/eq_op.rs:53:5
|
53 | a != b && b != a;
LL | a != b && b != a;
| ^^^^^^^^^^^^^^^^ help: try: `a != b`
error: this boolean expression can be simplified
--> $DIR/eq_op.rs:54:5
|
54 | a < b && b > a;
LL | a < b && b > a;
| ^^^^^^^^^^^^^^ help: try: `a < b`
error: this boolean expression can be simplified
--> $DIR/eq_op.rs:55:5
|
55 | a <= b && b >= a;
LL | a <= b && b >= a;
| ^^^^^^^^^^^^^^^^ help: try: `a <= b`
error: equal expressions as operands to `==`
--> $DIR/eq_op.rs:17:5
|
17 | 1 == 1;
LL | 1 == 1;
| ^^^^^^
|
= note: `-D clippy::eq-op` implied by `-D warnings`
@ -47,157 +47,157 @@ error: equal expressions as operands to `==`
error: equal expressions as operands to `==`
--> $DIR/eq_op.rs:18:5
|
18 | "no" == "no";
LL | "no" == "no";
| ^^^^^^^^^^^^
error: equal expressions as operands to `!=`
--> $DIR/eq_op.rs:20:5
|
20 | false != false;
LL | false != false;
| ^^^^^^^^^^^^^^
error: equal expressions as operands to `<`
--> $DIR/eq_op.rs:21:5
|
21 | 1.5 < 1.5;
LL | 1.5 < 1.5;
| ^^^^^^^^^
error: equal expressions as operands to `>=`
--> $DIR/eq_op.rs:22:5
|
22 | 1u64 >= 1u64;
LL | 1u64 >= 1u64;
| ^^^^^^^^^^^^
error: equal expressions as operands to `&`
--> $DIR/eq_op.rs:25:5
|
25 | (1 as u64) & (1 as u64);
LL | (1 as u64) & (1 as u64);
| ^^^^^^^^^^^^^^^^^^^^^^^
error: equal expressions as operands to `^`
--> $DIR/eq_op.rs:26:5
|
26 | 1 ^ ((((((1))))));
LL | 1 ^ ((((((1))))));
| ^^^^^^^^^^^^^^^^^
error: equal expressions as operands to `<`
--> $DIR/eq_op.rs:29:5
|
29 | (-(2) < -(2));
LL | (-(2) < -(2));
| ^^^^^^^^^^^^^
error: equal expressions as operands to `==`
--> $DIR/eq_op.rs:30:5
|
30 | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
LL | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: equal expressions as operands to `&`
--> $DIR/eq_op.rs:30:6
|
30 | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
LL | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
| ^^^^^^^^^^^^^^^^^
error: equal expressions as operands to `&`
--> $DIR/eq_op.rs:30:27
|
30 | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
LL | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
| ^^^^^^^^^^^^^^^^^
error: equal expressions as operands to `==`
--> $DIR/eq_op.rs:31:5
|
31 | (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
LL | (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: equal expressions as operands to `!=`
--> $DIR/eq_op.rs:34:5
|
34 | ([1] != [1]);
LL | ([1] != [1]);
| ^^^^^^^^^^^^
error: equal expressions as operands to `!=`
--> $DIR/eq_op.rs:35:5
|
35 | ((1, 2) != (1, 2));
LL | ((1, 2) != (1, 2));
| ^^^^^^^^^^^^^^^^^^
error: equal expressions as operands to `==`
--> $DIR/eq_op.rs:39:5
|
39 | 1 + 1 == 2;
LL | 1 + 1 == 2;
| ^^^^^^^^^^
error: equal expressions as operands to `==`
--> $DIR/eq_op.rs:40:5
|
40 | 1 - 1 == 0;
LL | 1 - 1 == 0;
| ^^^^^^^^^^
error: equal expressions as operands to `-`
--> $DIR/eq_op.rs:40:5
|
40 | 1 - 1 == 0;
LL | 1 - 1 == 0;
| ^^^^^
error: equal expressions as operands to `-`
--> $DIR/eq_op.rs:42:5
|
42 | 1 - 1;
LL | 1 - 1;
| ^^^^^
error: equal expressions as operands to `/`
--> $DIR/eq_op.rs:43:5
|
43 | 1 / 1;
LL | 1 / 1;
| ^^^^^
error: equal expressions as operands to `&&`
--> $DIR/eq_op.rs:44:5
|
44 | true && true;
LL | true && true;
| ^^^^^^^^^^^^
error: equal expressions as operands to `||`
--> $DIR/eq_op.rs:46:5
|
46 | true || true;
LL | true || true;
| ^^^^^^^^^^^^
error: equal expressions as operands to `&&`
--> $DIR/eq_op.rs:52:5
|
52 | a == b && b == a;
LL | a == b && b == a;
| ^^^^^^^^^^^^^^^^
error: equal expressions as operands to `&&`
--> $DIR/eq_op.rs:53:5
|
53 | a != b && b != a;
LL | a != b && b != a;
| ^^^^^^^^^^^^^^^^
error: equal expressions as operands to `&&`
--> $DIR/eq_op.rs:54:5
|
54 | a < b && b > a;
LL | a < b && b > a;
| ^^^^^^^^^^^^^^
error: equal expressions as operands to `&&`
--> $DIR/eq_op.rs:55:5
|
55 | a <= b && b >= a;
LL | a <= b && b >= a;
| ^^^^^^^^^^^^^^^^
error: equal expressions as operands to `==`
--> $DIR/eq_op.rs:58:5
|
58 | a == a;
LL | a == a;
| ^^^^^^
error: taken reference of right operand
--> $DIR/eq_op.rs:96:13
|
96 | let z = x & &y;
LL | let z = x & &y;
| ^^^^--
| |
| help: use the right value directly: `y`
@ -205,10 +205,10 @@ error: taken reference of right operand
= note: `-D clippy::op-ref` implied by `-D warnings`
error: equal expressions as operands to `/`
--> $DIR/eq_op.rs:104:20
|
104 | const D: u32 = A / A;
| ^^^^^
--> $DIR/eq_op.rs:104:20
|
LL | const D: u32 = A / A;
| ^^^^^
error: aborting due to 34 previous errors

View File

@ -1,7 +1,7 @@
error: this operation will always return zero. This is likely not the intended outcome
--> $DIR/erasing_op.rs:15:5
|
15 | x * 0;
LL | x * 0;
| ^^^^^
|
= note: `-D clippy::erasing-op` implied by `-D warnings`
@ -9,13 +9,13 @@ error: this operation will always return zero. This is likely not the intended o
error: this operation will always return zero. This is likely not the intended outcome
--> $DIR/erasing_op.rs:16:5
|
16 | 0 & x;
LL | 0 & x;
| ^^^^^
error: this operation will always return zero. This is likely not the intended outcome
--> $DIR/erasing_op.rs:17:5
|
17 | 0 / x;
LL | 0 / x;
| ^^^^^
error: aborting due to 3 previous errors

View File

@ -1,16 +1,16 @@
error: local variable doesn't need to be boxed here
--> $DIR/escape_analysis.rs:43:13
|
43 | fn warn_arg(x: Box<A>) {
LL | fn warn_arg(x: Box<A>) {
| ^
|
= note: `-D clippy::boxed-local` implied by `-D warnings`
error: local variable doesn't need to be boxed here
--> $DIR/escape_analysis.rs:134:12
|
134 | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {}
| ^^^^^^^^^^^
--> $DIR/escape_analysis.rs:134:12
|
LL | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {}
| ^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -1,7 +1,7 @@
error: redundant closure found
--> $DIR/eta.rs:22:27
|
22 | let a = Some(1u8).map(|a| foo(a));
LL | let a = Some(1u8).map(|a| foo(a));
| ^^^^^^^^^^ help: remove closure as shown: `foo`
|
= note: `-D clippy::redundant-closure` implied by `-D warnings`
@ -9,19 +9,19 @@ error: redundant closure found
error: redundant closure found
--> $DIR/eta.rs:23:10
|
23 | meta(|a| foo(a));
LL | meta(|a| foo(a));
| ^^^^^^^^^^ help: remove closure as shown: `foo`
error: redundant closure found
--> $DIR/eta.rs:24:27
|
24 | let c = Some(1u8).map(|a| {1+2; foo}(a));
LL | let c = Some(1u8).map(|a| {1+2; foo}(a));
| ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `{1+2; foo}`
error: this expression borrows a reference that is immediately dereferenced by the compiler
--> $DIR/eta.rs:26:21
|
26 | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
LL | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
| ^^^ help: change this to: `&2`
|
= note: `-D clippy::needless-borrow` implied by `-D warnings`
@ -29,7 +29,7 @@ error: this expression borrows a reference that is immediately dereferenced by t
error: redundant closure found
--> $DIR/eta.rs:33:27
|
33 | let e = Some(1u8).map(|a| generic(a));
LL | let e = Some(1u8).map(|a| generic(a));
| ^^^^^^^^^^^^^^ help: remove closure as shown: `generic`
error: aborting due to 5 previous errors

View File

@ -1,50 +1,50 @@
error: unsequenced read of a variable
--> $DIR/eval_order_dependence.rs:24:9
|
24 | } + x;
LL | } + x;
| ^
|
= note: `-D clippy::eval-order-dependence` implied by `-D warnings`
note: whether read occurs before this write depends on evaluation order
--> $DIR/eval_order_dependence.rs:22:9
|
22 | x = 1;
LL | x = 1;
| ^^^^^
error: unsequenced read of a variable
--> $DIR/eval_order_dependence.rs:27:5
|
27 | x += {
LL | x += {
| ^
|
note: whether read occurs before this write depends on evaluation order
--> $DIR/eval_order_dependence.rs:28:9
|
28 | x = 20;
LL | x = 20;
| ^^^^^^
error: unsequenced read of a variable
--> $DIR/eval_order_dependence.rs:40:12
|
40 | a: x,
LL | a: x,
| ^
|
note: whether read occurs before this write depends on evaluation order
--> $DIR/eval_order_dependence.rs:42:13
|
42 | x = 6;
LL | x = 6;
| ^^^^^
error: unsequenced read of a variable
--> $DIR/eval_order_dependence.rs:49:9
|
49 | x += {
LL | x += {
| ^
|
note: whether read occurs before this write depends on evaluation order
--> $DIR/eval_order_dependence.rs:50:13
|
50 | x = 20;
LL | x = 20;
| ^^^^^^
error: aborting due to 4 previous errors

View File

@ -1,7 +1,7 @@
error: float has excessive precision
--> $DIR/excessive_precision.rs:23:26
|
23 | const BAD32_1: f32 = 0.123_456_789_f32;
LL | const BAD32_1: f32 = 0.123_456_789_f32;
| ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_79`
|
= note: `-D clippy::excessive-precision` implied by `-D warnings`
@ -9,103 +9,103 @@ error: float has excessive precision
error: float has excessive precision
--> $DIR/excessive_precision.rs:24:26
|
24 | const BAD32_2: f32 = 0.123_456_789;
LL | const BAD32_2: f32 = 0.123_456_789;
| ^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_79`
error: float has excessive precision
--> $DIR/excessive_precision.rs:25:26
|
25 | const BAD32_3: f32 = 0.100_000_000_000_1;
LL | const BAD32_3: f32 = 0.100_000_000_000_1;
| ^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.1`
error: float has excessive precision
--> $DIR/excessive_precision.rs:26:29
|
26 | const BAD32_EDGE: f32 = 1.000_000_9;
LL | const BAD32_EDGE: f32 = 1.000_000_9;
| ^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.000_001`
error: float has excessive precision
--> $DIR/excessive_precision.rs:28:26
|
28 | const BAD64_1: f64 = 0.123_456_789_012_345_67f64;
LL | const BAD64_1: f64 = 0.123_456_789_012_345_67f64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_012_345_66`
error: float has excessive precision
--> $DIR/excessive_precision.rs:29:26
|
29 | const BAD64_2: f64 = 0.123_456_789_012_345_67;
LL | const BAD64_2: f64 = 0.123_456_789_012_345_67;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_012_345_66`
error: float has excessive precision
--> $DIR/excessive_precision.rs:30:26
|
30 | const BAD64_3: f64 = 0.100_000_000_000_000_000_1;
LL | const BAD64_3: f64 = 0.100_000_000_000_000_000_1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.1`
error: float has excessive precision
--> $DIR/excessive_precision.rs:33:22
|
33 | println!("{:?}", 8.888_888_888_888_888_888_888);
LL | println!("{:?}", 8.888_888_888_888_888_888_888);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `8.888_888_888_888_89`
error: float has excessive precision
--> $DIR/excessive_precision.rs:44:22
|
44 | let bad32: f32 = 1.123_456_789;
LL | let bad32: f32 = 1.123_456_789;
| ^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8`
error: float has excessive precision
--> $DIR/excessive_precision.rs:45:26
|
45 | let bad32_suf: f32 = 1.123_456_789_f32;
LL | let bad32_suf: f32 = 1.123_456_789_f32;
| ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8`
error: float has excessive precision
--> $DIR/excessive_precision.rs:46:21
|
46 | let bad32_inf = 1.123_456_789_f32;
LL | let bad32_inf = 1.123_456_789_f32;
| ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8`
error: float has excessive precision
--> $DIR/excessive_precision.rs:48:22
|
48 | let bad64: f64 = 0.123_456_789_012_345_67;
LL | let bad64: f64 = 0.123_456_789_012_345_67;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_012_345_66`
error: float has excessive precision
--> $DIR/excessive_precision.rs:49:26
|
49 | let bad64_suf: f64 = 0.123_456_789_012_345_67f64;
LL | let bad64_suf: f64 = 0.123_456_789_012_345_67f64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_012_345_66`
error: float has excessive precision
--> $DIR/excessive_precision.rs:50:21
|
50 | let bad64_inf = 0.123_456_789_012_345_67;
LL | let bad64_inf = 0.123_456_789_012_345_67;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_012_345_66`
error: float has excessive precision
--> $DIR/excessive_precision.rs:56:36
|
56 | let bad_vec32: Vec<f32> = vec![0.123_456_789];
LL | let bad_vec32: Vec<f32> = vec![0.123_456_789];
| ^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_79`
error: float has excessive precision
--> $DIR/excessive_precision.rs:57:36
|
57 | let bad_vec64: Vec<f64> = vec![0.123_456_789_123_456_789];
LL | let bad_vec64: Vec<f64> = vec![0.123_456_789_123_456_789];
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_123_456_78`
error: float has excessive precision
--> $DIR/excessive_precision.rs:61:24
|
61 | let bad_e32: f32 = 1.123_456_788_888e-10;
LL | let bad_e32: f32 = 1.123_456_788_888e-10;
| ^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8e-10`
error: float has excessive precision
--> $DIR/excessive_precision.rs:64:27
|
64 | let bad_bige32: f32 = 1.123_456_788_888E-10;
LL | let bad_bige32: f32 = 1.123_456_788_888E-10;
| ^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8E-10`
error: aborting due to 18 previous errors

View File

@ -1,7 +1,7 @@
error: use of `expect` followed by a function call
--> $DIR/expect_fun_call.rs:36:26
|
36 | with_none_and_format.expect(&format!("Error {}: fake error", error_code));
LL | with_none_and_format.expect(&format!("Error {}: fake error", error_code));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
|
= note: `-D clippy::expect-fun-call` implied by `-D warnings`
@ -9,31 +9,31 @@ error: use of `expect` followed by a function call
error: use of `expect` followed by a function call
--> $DIR/expect_fun_call.rs:39:26
|
39 | with_none_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
LL | with_none_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
error: use of `expect` followed by a function call
--> $DIR/expect_fun_call.rs:49:25
|
49 | with_err_and_format.expect(&format!("Error {}: fake error", error_code));
LL | with_err_and_format.expect(&format!("Error {}: fake error", error_code));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
error: use of `expect` followed by a function call
--> $DIR/expect_fun_call.rs:52:25
|
52 | with_err_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
LL | with_err_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
error: use of `expect` followed by a function call
--> $DIR/expect_fun_call.rs:67:17
|
67 | Some("foo").expect({ &format!("error") });
LL | Some("foo").expect({ &format!("error") });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { let msg = { &format!("error") }; panic!(msg) }))`
error: use of `expect` followed by a function call
--> $DIR/expect_fun_call.rs:68:17
|
68 | Some("foo").expect(format!("error").as_ref());
LL | Some("foo").expect(format!("error").as_ref());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("error"))`
error: aborting due to 6 previous errors

View File

@ -1,7 +1,7 @@
error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
--> $DIR/explicit_counter_loop.rs:15:15
|
15 | for _v in &vec {
LL | for _v in &vec {
| ^^^^
|
= note: `-D clippy::explicit-counter-loop` implied by `-D warnings`
@ -9,19 +9,19 @@ error: the variable `_index` is used as a loop counter. Consider using `for (_in
error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
--> $DIR/explicit_counter_loop.rs:21:15
|
21 | for _v in &vec {
LL | for _v in &vec {
| ^^^^
error: the variable `count` is used as a loop counter. Consider using `for (count, item) in text.chars().enumerate()` or similar iterators
--> $DIR/explicit_counter_loop.rs:60:19
|
60 | for ch in text.chars() {
LL | for ch in text.chars() {
| ^^^^^^^^^^^^
error: the variable `count` is used as a loop counter. Consider using `for (count, item) in text.chars().enumerate()` or similar iterators
--> $DIR/explicit_counter_loop.rs:71:19
|
71 | for ch in text.chars() {
LL | for ch in text.chars() {
| ^^^^^^^^^^^^
error: aborting due to 4 previous errors

View File

@ -1,7 +1,7 @@
error: use of `write!(stdout(), ...).unwrap()`
--> $DIR/explicit_write.rs:24:9
|
24 | write!(std::io::stdout(), "test").unwrap();
LL | write!(std::io::stdout(), "test").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `print!("test")`
|
= note: `-D clippy::explicit-write` implied by `-D warnings`
@ -9,43 +9,43 @@ error: use of `write!(stdout(), ...).unwrap()`
error: use of `write!(stderr(), ...).unwrap()`
--> $DIR/explicit_write.rs:25:9
|
25 | write!(std::io::stderr(), "test").unwrap();
LL | write!(std::io::stderr(), "test").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `eprint!("test")`
error: use of `writeln!(stdout(), ...).unwrap()`
--> $DIR/explicit_write.rs:26:9
|
26 | writeln!(std::io::stdout(), "test").unwrap();
LL | writeln!(std::io::stdout(), "test").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `println!("test")`
error: use of `writeln!(stderr(), ...).unwrap()`
--> $DIR/explicit_write.rs:27:9
|
27 | writeln!(std::io::stderr(), "test").unwrap();
LL | writeln!(std::io::stderr(), "test").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `eprintln!("test")`
error: use of `stdout().write_fmt(...).unwrap()`
--> $DIR/explicit_write.rs:28:9
|
28 | std::io::stdout().write_fmt(format_args!("test")).unwrap();
LL | std::io::stdout().write_fmt(format_args!("test")).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `print!("test")`
error: use of `stderr().write_fmt(...).unwrap()`
--> $DIR/explicit_write.rs:29:9
|
29 | std::io::stderr().write_fmt(format_args!("test")).unwrap();
LL | std::io::stderr().write_fmt(format_args!("test")).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `eprint!("test")`
error: use of `writeln!(stdout(), ...).unwrap()`
--> $DIR/explicit_write.rs:32:9
|
32 | writeln!(std::io::stdout(), "test/ntest").unwrap();
LL | writeln!(std::io::stdout(), "test/ntest").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `println!("test/ntest")`
error: use of `writeln!(stderr(), ...).unwrap()`
--> $DIR/explicit_write.rs:33:9
|
33 | writeln!(std::io::stderr(), "test/ntest").unwrap();
LL | writeln!(std::io::stderr(), "test/ntest").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `eprintln!("test/ntest")`
error: aborting due to 8 previous errors

View File

@ -1,91 +1,91 @@
error: consider implementing `TryFrom` instead
--> $DIR/fallible_impl_from.rs:14:1
|
14 | / impl From<String> for Foo {
15 | | fn from(s: String) -> Self {
16 | | Foo(s.parse().unwrap())
17 | | }
18 | | }
LL | / impl From<String> for Foo {
LL | | fn from(s: String) -> Self {
LL | | Foo(s.parse().unwrap())
LL | | }
LL | | }
| |_^
|
note: lint level defined here
--> $DIR/fallible_impl_from.rs:10:9
|
10 | #![deny(clippy::fallible_impl_from)]
LL | #![deny(clippy::fallible_impl_from)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
note: potential failure(s)
--> $DIR/fallible_impl_from.rs:16:13
|
16 | Foo(s.parse().unwrap())
LL | Foo(s.parse().unwrap())
| ^^^^^^^^^^^^^^^^^^
error: consider implementing `TryFrom` instead
--> $DIR/fallible_impl_from.rs:35:1
|
35 | / impl From<usize> for Invalid {
36 | | fn from(i: usize) -> Invalid {
37 | | if i != 42 {
38 | | panic!();
LL | / impl From<usize> for Invalid {
LL | | fn from(i: usize) -> Invalid {
LL | | if i != 42 {
LL | | panic!();
... |
41 | | }
42 | | }
LL | | }
LL | | }
| |_^
|
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
note: potential failure(s)
--> $DIR/fallible_impl_from.rs:38:13
|
38 | panic!();
LL | panic!();
| ^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: consider implementing `TryFrom` instead
--> $DIR/fallible_impl_from.rs:44:1
|
44 | / impl From<Option<String>> for Invalid {
45 | | fn from(s: Option<String>) -> Invalid {
46 | | let s = s.unwrap();
47 | | if !s.is_empty() {
LL | / impl From<Option<String>> for Invalid {
LL | | fn from(s: Option<String>) -> Invalid {
LL | | let s = s.unwrap();
LL | | if !s.is_empty() {
... |
53 | | }
54 | | }
LL | | }
LL | | }
| |_^
|
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
note: potential failure(s)
--> $DIR/fallible_impl_from.rs:46:17
|
46 | let s = s.unwrap();
LL | let s = s.unwrap();
| ^^^^^^^^^^
47 | if !s.is_empty() {
48 | panic!(42);
LL | if !s.is_empty() {
LL | panic!(42);
| ^^^^^^^^^^^
49 | } else if s.parse::<u32>().unwrap() != 42 {
LL | } else if s.parse::<u32>().unwrap() != 42 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
50 | panic!("{:?}", s);
LL | panic!("{:?}", s);
| ^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: consider implementing `TryFrom` instead
--> $DIR/fallible_impl_from.rs:62:1
|
62 | / impl<'a> From<&'a mut <Box<u32> as ProjStrTrait>::ProjString> for Invalid {
63 | | fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
64 | | if s.parse::<u32>().ok().unwrap() != 42 {
65 | | panic!("{:?}", s);
LL | / impl<'a> From<&'a mut <Box<u32> as ProjStrTrait>::ProjString> for Invalid {
LL | | fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
LL | | if s.parse::<u32>().ok().unwrap() != 42 {
LL | | panic!("{:?}", s);
... |
68 | | }
69 | | }
LL | | }
LL | | }
| |_^
|
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
note: potential failure(s)
--> $DIR/fallible_impl_from.rs:64:12
|
64 | if s.parse::<u32>().ok().unwrap() != 42 {
LL | if s.parse::<u32>().ok().unwrap() != 42 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65 | panic!("{:?}", s);
LL | panic!("{:?}", s);
| ^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

View File

@ -1,7 +1,7 @@
error: called `filter(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.filter_map(..)` instead.
--> $DIR/filter_methods.rs:14:21
|
14 | let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
LL | let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::filter-map` implied by `-D warnings`
@ -9,31 +9,31 @@ error: called `filter(p).map(q)` on an `Iterator`. This is more succinctly expre
error: called `filter(p).flat_map(q)` on an `Iterator`. This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator.
--> $DIR/filter_methods.rs:16:21
|
16 | let _: Vec<_> = vec![5_i8; 6]
LL | let _: Vec<_> = vec![5_i8; 6]
| _____________________^
17 | | .into_iter()
18 | | .filter(|&x| x == 0)
19 | | .flat_map(|x| x.checked_mul(2))
LL | | .into_iter()
LL | | .filter(|&x| x == 0)
LL | | .flat_map(|x| x.checked_mul(2))
| |_______________________________________^
error: called `filter_map(p).flat_map(q)` on an `Iterator`. This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator.
--> $DIR/filter_methods.rs:22:21
|
22 | let _: Vec<_> = vec![5_i8; 6]
LL | let _: Vec<_> = vec![5_i8; 6]
| _____________________^
23 | | .into_iter()
24 | | .filter_map(|x| x.checked_mul(2))
25 | | .flat_map(|x| x.checked_mul(2))
LL | | .into_iter()
LL | | .filter_map(|x| x.checked_mul(2))
LL | | .flat_map(|x| x.checked_mul(2))
| |_______________________________________^
error: called `filter_map(p).map(q)` on an `Iterator`. This is more succinctly expressed by only calling `.filter_map(..)` instead.
--> $DIR/filter_methods.rs:28:21
|
28 | let _: Vec<_> = vec![5_i8; 6]
LL | let _: Vec<_> = vec![5_i8; 6]
| _____________________^
29 | | .into_iter()
30 | | .filter_map(|x| x.checked_mul(2))
31 | | .map(|x| x.checked_mul(2))
LL | | .into_iter()
LL | | .filter_map(|x| x.checked_mul(2))
LL | | .map(|x| x.checked_mul(2))
| |__________________________________^
error: aborting due to 4 previous errors

View File

@ -1,38 +1,38 @@
error: strict comparison of f32 or f64
--> $DIR/float_cmp.rs:69:5
|
69 | ONE as f64 != 2.0;
LL | ONE as f64 != 2.0;
| ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(ONE as f64 - 2.0).abs() < error`
|
= note: `-D clippy::float-cmp` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp.rs:69:5
|
69 | ONE as f64 != 2.0;
LL | ONE as f64 != 2.0;
| ^^^^^^^^^^^^^^^^^
error: strict comparison of f32 or f64
--> $DIR/float_cmp.rs:74:5
|
74 | x == 1.0;
LL | x == 1.0;
| ^^^^^^^^ help: consider comparing them within some error: `(x - 1.0).abs() < error`
|
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp.rs:74:5
|
74 | x == 1.0;
LL | x == 1.0;
| ^^^^^^^^
error: strict comparison of f32 or f64
--> $DIR/float_cmp.rs:77:5
|
77 | twice(x) != twice(ONE as f64);
LL | twice(x) != twice(ONE as f64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(twice(x) - twice(ONE as f64)).abs() < error`
|
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp.rs:77:5
|
77 | twice(x) != twice(ONE as f64);
LL | twice(x) != twice(ONE as f64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors

View File

@ -1,86 +1,86 @@
error: strict comparison of f32 or f64 constant
--> $DIR/float_cmp_const.rs:27:5
|
27 | 1f32 == ONE;
LL | 1f32 == ONE;
| ^^^^^^^^^^^ help: consider comparing them within some error: `(1f32 - ONE).abs() < error`
|
= note: `-D clippy::float-cmp-const` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp_const.rs:27:5
|
27 | 1f32 == ONE;
LL | 1f32 == ONE;
| ^^^^^^^^^^^
error: strict comparison of f32 or f64 constant
--> $DIR/float_cmp_const.rs:28:5
|
28 | TWO == ONE;
LL | TWO == ONE;
| ^^^^^^^^^^ help: consider comparing them within some error: `(TWO - ONE).abs() < error`
|
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp_const.rs:28:5
|
28 | TWO == ONE;
LL | TWO == ONE;
| ^^^^^^^^^^
error: strict comparison of f32 or f64 constant
--> $DIR/float_cmp_const.rs:29:5
|
29 | TWO != ONE;
LL | TWO != ONE;
| ^^^^^^^^^^ help: consider comparing them within some error: `(TWO - ONE).abs() < error`
|
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp_const.rs:29:5
|
29 | TWO != ONE;
LL | TWO != ONE;
| ^^^^^^^^^^
error: strict comparison of f32 or f64 constant
--> $DIR/float_cmp_const.rs:30:5
|
30 | ONE + ONE == TWO;
LL | ONE + ONE == TWO;
| ^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(ONE + ONE - TWO).abs() < error`
|
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp_const.rs:30:5
|
30 | ONE + ONE == TWO;
LL | ONE + ONE == TWO;
| ^^^^^^^^^^^^^^^^
error: strict comparison of f32 or f64 constant
--> $DIR/float_cmp_const.rs:31:5
|
31 | 1 as f32 == ONE;
LL | 1 as f32 == ONE;
| ^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(1 as f32 - ONE).abs() < error`
|
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp_const.rs:31:5
|
31 | 1 as f32 == ONE;
LL | 1 as f32 == ONE;
| ^^^^^^^^^^^^^^^
error: strict comparison of f32 or f64 constant
--> $DIR/float_cmp_const.rs:34:5
|
34 | v == ONE;
LL | v == ONE;
| ^^^^^^^^ help: consider comparing them within some error: `(v - ONE).abs() < error`
|
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp_const.rs:34:5
|
34 | v == ONE;
LL | v == ONE;
| ^^^^^^^^
error: strict comparison of f32 or f64 constant
--> $DIR/float_cmp_const.rs:35:5
|
35 | v != ONE;
LL | v != ONE;
| ^^^^^^^^ help: consider comparing them within some error: `(v - ONE).abs() < error`
|
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> $DIR/float_cmp_const.rs:35:5
|
35 | v != ONE;
LL | v != ONE;
| ^^^^^^^^
error: aborting due to 7 previous errors

View File

@ -1,7 +1,7 @@
error: casting function pointer `foo` to `i8`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:19:13
|
19 | let _ = foo as i8;
LL | let _ = foo as i8;
| ^^^^^^^^^ help: try: `foo as usize`
|
= note: `-D clippy::fn-to-numeric-cast-with-truncation` implied by `-D warnings`
@ -9,19 +9,19 @@ error: casting function pointer `foo` to `i8`, which truncates the value
error: casting function pointer `foo` to `i16`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:20:13
|
20 | let _ = foo as i16;
LL | let _ = foo as i16;
| ^^^^^^^^^^ help: try: `foo as usize`
error: casting function pointer `foo` to `i32`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:21:13
|
21 | let _ = foo as i32;
LL | let _ = foo as i32;
| ^^^^^^^^^^ help: try: `foo as usize`
error: casting function pointer `foo` to `i64`
--> $DIR/fn_to_numeric_cast.rs:22:13
|
22 | let _ = foo as i64;
LL | let _ = foo as i64;
| ^^^^^^^^^^ help: try: `foo as usize`
|
= note: `-D clippy::fn-to-numeric-cast` implied by `-D warnings`
@ -29,115 +29,115 @@ error: casting function pointer `foo` to `i64`
error: casting function pointer `foo` to `i128`
--> $DIR/fn_to_numeric_cast.rs:23:13
|
23 | let _ = foo as i128;
LL | let _ = foo as i128;
| ^^^^^^^^^^^ help: try: `foo as usize`
error: casting function pointer `foo` to `isize`
--> $DIR/fn_to_numeric_cast.rs:24:13
|
24 | let _ = foo as isize;
LL | let _ = foo as isize;
| ^^^^^^^^^^^^ help: try: `foo as usize`
error: casting function pointer `foo` to `u8`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:26:13
|
26 | let _ = foo as u8;
LL | let _ = foo as u8;
| ^^^^^^^^^ help: try: `foo as usize`
error: casting function pointer `foo` to `u16`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:27:13
|
27 | let _ = foo as u16;
LL | let _ = foo as u16;
| ^^^^^^^^^^ help: try: `foo as usize`
error: casting function pointer `foo` to `u32`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:28:13
|
28 | let _ = foo as u32;
LL | let _ = foo as u32;
| ^^^^^^^^^^ help: try: `foo as usize`
error: casting function pointer `foo` to `u64`
--> $DIR/fn_to_numeric_cast.rs:29:13
|
29 | let _ = foo as u64;
LL | let _ = foo as u64;
| ^^^^^^^^^^ help: try: `foo as usize`
error: casting function pointer `foo` to `u128`
--> $DIR/fn_to_numeric_cast.rs:30:13
|
30 | let _ = foo as u128;
LL | let _ = foo as u128;
| ^^^^^^^^^^^ help: try: `foo as usize`
error: casting function pointer `abc` to `i8`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:43:13
|
43 | let _ = abc as i8;
LL | let _ = abc as i8;
| ^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `i16`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:44:13
|
44 | let _ = abc as i16;
LL | let _ = abc as i16;
| ^^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `i32`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:45:13
|
45 | let _ = abc as i32;
LL | let _ = abc as i32;
| ^^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `i64`
--> $DIR/fn_to_numeric_cast.rs:46:13
|
46 | let _ = abc as i64;
LL | let _ = abc as i64;
| ^^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `i128`
--> $DIR/fn_to_numeric_cast.rs:47:13
|
47 | let _ = abc as i128;
LL | let _ = abc as i128;
| ^^^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `isize`
--> $DIR/fn_to_numeric_cast.rs:48:13
|
48 | let _ = abc as isize;
LL | let _ = abc as isize;
| ^^^^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `u8`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:50:13
|
50 | let _ = abc as u8;
LL | let _ = abc as u8;
| ^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `u16`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:51:13
|
51 | let _ = abc as u16;
LL | let _ = abc as u16;
| ^^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `u32`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:52:13
|
52 | let _ = abc as u32;
LL | let _ = abc as u32;
| ^^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `u64`
--> $DIR/fn_to_numeric_cast.rs:53:13
|
53 | let _ = abc as u64;
LL | let _ = abc as u64;
| ^^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `abc` to `u128`
--> $DIR/fn_to_numeric_cast.rs:54:13
|
54 | let _ = abc as u128;
LL | let _ = abc as u128;
| ^^^^^^^^^^^ help: try: `abc as usize`
error: casting function pointer `f` to `i32`, which truncates the value
--> $DIR/fn_to_numeric_cast.rs:61:5
|
61 | f as i32
LL | f as i32
| ^^^^^^^^ help: try: `f as usize`
error: aborting due to 23 previous errors

View File

@ -1,421 +1,421 @@
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:50:14
|
50 | for i in 0..vec.len() {
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
|
= note: `-D clippy::needless-range-loop` implied by `-D warnings`
help: consider using an iterator
|
50 | for <item> in &vec {
LL | for <item> in &vec {
| ^^^^^^ ^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:59:14
|
59 | for i in 0..vec.len() {
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
|
59 | for <item> in &vec {
LL | for <item> in &vec {
| ^^^^^^ ^^^^
error: the loop variable `j` is only used to index `STATIC`.
--> $DIR/for_loop.rs:64:14
|
64 | for j in 0..4 {
LL | for j in 0..4 {
| ^^^^
help: consider using an iterator
|
64 | for <item> in &STATIC {
LL | for <item> in &STATIC {
| ^^^^^^ ^^^^^^^
error: the loop variable `j` is only used to index `CONST`.
--> $DIR/for_loop.rs:68:14
|
68 | for j in 0..4 {
LL | for j in 0..4 {
| ^^^^
help: consider using an iterator
|
68 | for <item> in &CONST {
LL | for <item> in &CONST {
| ^^^^^^ ^^^^^^
error: the loop variable `i` is used to index `vec`
--> $DIR/for_loop.rs:72:14
|
72 | for i in 0..vec.len() {
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
|
72 | for (i, <item>) in vec.iter().enumerate() {
LL | for (i, <item>) in vec.iter().enumerate() {
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec2`.
--> $DIR/for_loop.rs:80:14
|
80 | for i in 0..vec.len() {
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
|
80 | for <item> in vec2.iter().take(vec.len()) {
LL | for <item> in vec2.iter().take(vec.len()) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:84:14
|
84 | for i in 5..vec.len() {
LL | for i in 5..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
|
84 | for <item> in vec.iter().skip(5) {
LL | for <item> in vec.iter().skip(5) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:88:14
|
88 | for i in 0..MAX_LEN {
LL | for i in 0..MAX_LEN {
| ^^^^^^^^^^
help: consider using an iterator
|
88 | for <item> in vec.iter().take(MAX_LEN) {
LL | for <item> in vec.iter().take(MAX_LEN) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:92:14
|
92 | for i in 0..=MAX_LEN {
LL | for i in 0..=MAX_LEN {
| ^^^^^^^^^^^
help: consider using an iterator
|
92 | for <item> in vec.iter().take(MAX_LEN + 1) {
LL | for <item> in vec.iter().take(MAX_LEN + 1) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:96:14
|
96 | for i in 5..10 {
LL | for i in 5..10 {
| ^^^^^
help: consider using an iterator
|
96 | for <item> in vec.iter().take(10).skip(5) {
LL | for <item> in vec.iter().take(10).skip(5) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:100:14
|
100 | for i in 5..=10 {
| ^^^^^^
--> $DIR/for_loop.rs:100:14
|
LL | for i in 5..=10 {
| ^^^^^^
help: consider using an iterator
|
100 | for <item> in vec.iter().take(10 + 1).skip(5) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
LL | for <item> in vec.iter().take(10 + 1).skip(5) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is used to index `vec`
--> $DIR/for_loop.rs:104:14
|
104 | for i in 5..vec.len() {
| ^^^^^^^^^^^^
--> $DIR/for_loop.rs:104:14
|
LL | for i in 5..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
|
104 | for (i, <item>) in vec.iter().enumerate().skip(5) {
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
LL | for (i, <item>) in vec.iter().enumerate().skip(5) {
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is used to index `vec`
--> $DIR/for_loop.rs:108:14
|
108 | for i in 5..10 {
| ^^^^^
--> $DIR/for_loop.rs:108:14
|
LL | for i in 5..10 {
| ^^^^^
help: consider using an iterator
|
108 | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
LL | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:112:14
|
112 | for i in 10..0 {
| ^^^^^
|
= note: `-D clippy::reverse-range-loop` implied by `-D warnings`
--> $DIR/for_loop.rs:112:14
|
LL | for i in 10..0 {
| ^^^^^
|
= note: `-D clippy::reverse-range-loop` implied by `-D warnings`
help: consider using the following if you are attempting to iterate over this range in reverse
|
112 | for i in (0..10).rev() {
| ^^^^^^^^^^^^^
|
LL | for i in (0..10).rev() {
| ^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:116:14
|
116 | for i in 10..=0 {
| ^^^^^^
--> $DIR/for_loop.rs:116:14
|
LL | for i in 10..=0 {
| ^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
|
116 | for i in (0...10).rev() {
| ^^^^^^^^^^^^^^
|
LL | for i in (0...10).rev() {
| ^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:120:14
|
120 | for i in MAX_LEN..0 {
| ^^^^^^^^^^
--> $DIR/for_loop.rs:120:14
|
LL | for i in MAX_LEN..0 {
| ^^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
|
120 | for i in (0..MAX_LEN).rev() {
| ^^^^^^^^^^^^^^^^^^
|
LL | for i in (0..MAX_LEN).rev() {
| ^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:124:14
|
124 | for i in 5..5 {
| ^^^^
--> $DIR/for_loop.rs:124:14
|
LL | for i in 5..5 {
| ^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:149:14
|
149 | for i in 10..5 + 4 {
| ^^^^^^^^^
--> $DIR/for_loop.rs:149:14
|
LL | for i in 10..5 + 4 {
| ^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
|
149 | for i in (5 + 4..10).rev() {
| ^^^^^^^^^^^^^^^^^
|
LL | for i in (5 + 4..10).rev() {
| ^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:153:14
|
153 | for i in (5 + 2)..(3 - 1) {
| ^^^^^^^^^^^^^^^^
--> $DIR/for_loop.rs:153:14
|
LL | for i in (5 + 2)..(3 - 1) {
| ^^^^^^^^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
|
153 | for i in ((3 - 1)..(5 + 2)).rev() {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
LL | for i in ((3 - 1)..(5 + 2)).rev() {
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:157:14
|
157 | for i in (5 + 2)..(8 - 1) {
| ^^^^^^^^^^^^^^^^
--> $DIR/for_loop.rs:157:14
|
LL | for i in (5 + 2)..(8 - 1) {
| ^^^^^^^^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:179:15
|
179 | for _v in vec.iter() {}
| ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
|
= note: `-D clippy::explicit-iter-loop` implied by `-D warnings`
--> $DIR/for_loop.rs:179:15
|
LL | for _v in vec.iter() {}
| ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
|
= note: `-D clippy::explicit-iter-loop` implied by `-D warnings`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:181:15
|
181 | for _v in vec.iter_mut() {}
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
--> $DIR/for_loop.rs:181:15
|
LL | for _v in vec.iter_mut() {}
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
error: it is more concise to loop over containers instead of using explicit iteration methods`
--> $DIR/for_loop.rs:184:15
|
184 | for _v in out_vec.into_iter() {}
| ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `out_vec`
|
= note: `-D clippy::explicit-into-iter-loop` implied by `-D warnings`
--> $DIR/for_loop.rs:184:15
|
LL | for _v in out_vec.into_iter() {}
| ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `out_vec`
|
= note: `-D clippy::explicit-into-iter-loop` implied by `-D warnings`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:187:15
|
187 | for _v in array.into_iter() {}
| ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
--> $DIR/for_loop.rs:187:15
|
LL | for _v in array.into_iter() {}
| ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:192:15
|
192 | for _v in [1, 2, 3].iter() {}
| ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
--> $DIR/for_loop.rs:192:15
|
LL | for _v in [1, 2, 3].iter() {}
| ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:196:15
|
196 | for _v in [0; 32].iter() {}
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
--> $DIR/for_loop.rs:196:15
|
LL | for _v in [0; 32].iter() {}
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:201:15
|
201 | for _v in ll.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&ll`
--> $DIR/for_loop.rs:201:15
|
LL | for _v in ll.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&ll`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:204:15
|
204 | for _v in vd.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&vd`
--> $DIR/for_loop.rs:204:15
|
LL | for _v in vd.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&vd`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:207:15
|
207 | for _v in bh.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&bh`
--> $DIR/for_loop.rs:207:15
|
LL | for _v in bh.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&bh`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:210:15
|
210 | for _v in hm.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&hm`
--> $DIR/for_loop.rs:210:15
|
LL | for _v in hm.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&hm`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:213:15
|
213 | for _v in bt.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&bt`
--> $DIR/for_loop.rs:213:15
|
LL | for _v in bt.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&bt`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:216:15
|
216 | for _v in hs.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&hs`
--> $DIR/for_loop.rs:216:15
|
LL | for _v in hs.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&hs`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:219:15
|
219 | for _v in bs.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&bs`
--> $DIR/for_loop.rs:219:15
|
LL | for _v in bs.iter() {}
| ^^^^^^^^^ help: to write this more concisely, try: `&bs`
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
--> $DIR/for_loop.rs:221:15
|
221 | for _v in vec.iter().next() {}
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::iter-next-loop` implied by `-D warnings`
--> $DIR/for_loop.rs:221:15
|
LL | for _v in vec.iter().next() {}
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::iter-next-loop` implied by `-D warnings`
error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
--> $DIR/for_loop.rs:228:5
|
228 | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unused-collect` implied by `-D warnings`
--> $DIR/for_loop.rs:228:5
|
LL | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unused-collect` implied by `-D warnings`
error: you seem to want to iterate on a map's values
--> $DIR/for_loop.rs:337:19
|
337 | for (_, v) in &m {
| ^^
|
= note: `-D clippy::for-kv-map` implied by `-D warnings`
--> $DIR/for_loop.rs:337:19
|
LL | for (_, v) in &m {
| ^^
|
= note: `-D clippy::for-kv-map` implied by `-D warnings`
help: use the corresponding method
|
337 | for v in m.values() {
| ^ ^^^^^^^^^^
|
LL | for v in m.values() {
| ^ ^^^^^^^^^^
error: you seem to want to iterate on a map's values
--> $DIR/for_loop.rs:342:19
|
342 | for (_, v) in &*m {
| ^^^
--> $DIR/for_loop.rs:342:19
|
LL | for (_, v) in &*m {
| ^^^
help: use the corresponding method
|
342 | for v in (*m).values() {
| ^ ^^^^^^^^^^^^^
|
LL | for v in (*m).values() {
| ^ ^^^^^^^^^^^^^
error: you seem to want to iterate on a map's values
--> $DIR/for_loop.rs:350:19
|
350 | for (_, v) in &mut m {
| ^^^^^^
--> $DIR/for_loop.rs:350:19
|
LL | for (_, v) in &mut m {
| ^^^^^^
help: use the corresponding method
|
350 | for v in m.values_mut() {
| ^ ^^^^^^^^^^^^^^
|
LL | for v in m.values_mut() {
| ^ ^^^^^^^^^^^^^^
error: you seem to want to iterate on a map's values
--> $DIR/for_loop.rs:355:19
|
355 | for (_, v) in &mut *m {
| ^^^^^^^
--> $DIR/for_loop.rs:355:19
|
LL | for (_, v) in &mut *m {
| ^^^^^^^
help: use the corresponding method
|
355 | for v in (*m).values_mut() {
| ^ ^^^^^^^^^^^^^^^^^
|
LL | for v in (*m).values_mut() {
| ^ ^^^^^^^^^^^^^^^^^
error: you seem to want to iterate on a map's keys
--> $DIR/for_loop.rs:361:24
|
361 | for (k, _value) in rm {
| ^^
--> $DIR/for_loop.rs:361:24
|
LL | for (k, _value) in rm {
| ^^
help: use the corresponding method
|
361 | for k in rm.keys() {
| ^ ^^^^^^^^^
|
LL | for k in rm.keys() {
| ^ ^^^^^^^^^
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:414:14
|
414 | for i in 0..src.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
|
= note: `-D clippy::manual-memcpy` implied by `-D warnings`
--> $DIR/for_loop.rs:414:14
|
LL | for i in 0..src.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
|
= note: `-D clippy::manual-memcpy` implied by `-D warnings`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:419:14
|
419 | for i in 0..src.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])`
--> $DIR/for_loop.rs:419:14
|
LL | for i in 0..src.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:424:14
|
424 | for i in 0..src.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..])`
--> $DIR/for_loop.rs:424:14
|
LL | for i in 0..src.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:429:14
|
429 | for i in 11..src.len() {
| ^^^^^^^^^^^^^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])`
--> $DIR/for_loop.rs:429:14
|
LL | for i in 11..src.len() {
| ^^^^^^^^^^^^^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:434:14
|
434 | for i in 0..dst.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])`
--> $DIR/for_loop.rs:434:14
|
LL | for i in 0..dst.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:447:14
|
447 | for i in 10..256 {
| ^^^^^^^
--> $DIR/for_loop.rs:447:14
|
LL | for i in 10..256 {
| ^^^^^^^
help: try replacing the loop by
|
447 | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
448 | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]) {
|
|
LL | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
LL | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]) {
|
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:459:14
|
459 | for i in 10..LOOP_OFFSET {
| ^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[(10 + LOOP_OFFSET)..(LOOP_OFFSET + LOOP_OFFSET)].clone_from_slice(&src[(10 - some_var)..(LOOP_OFFSET - some_var)])`
--> $DIR/for_loop.rs:459:14
|
LL | for i in 10..LOOP_OFFSET {
| ^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[(10 + LOOP_OFFSET)..(LOOP_OFFSET + LOOP_OFFSET)].clone_from_slice(&src[(10 - some_var)..(LOOP_OFFSET - some_var)])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:472:14
|
472 | for i in 0..src_vec.len() {
| ^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..])`
--> $DIR/for_loop.rs:472:14
|
LL | for i in 0..src_vec.len() {
| ^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:501:14
|
501 | for i in from..from + src.len() {
| ^^^^^^^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + src.len()].clone_from_slice(&src[0..(from + src.len() - from)])`
--> $DIR/for_loop.rs:501:14
|
LL | for i in from..from + src.len() {
| ^^^^^^^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + src.len()].clone_from_slice(&src[0..(from + src.len() - from)])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:505:14
|
505 | for i in from..from + 3 {
| ^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + 3].clone_from_slice(&src[0..(from + 3 - from)])`
--> $DIR/for_loop.rs:505:14
|
LL | for i in from..from + 3 {
| ^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + 3].clone_from_slice(&src[0..(from + 3 - from)])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:512:14
|
512 | for i in 0..src.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
--> $DIR/for_loop.rs:512:14
|
LL | for i in 0..src.len() {
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
error: aborting due to 51 previous errors

View File

@ -1,7 +1,7 @@
error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement.
--> $DIR/for_loop_over_option_result.rs:20:14
|
20 | for x in option {
LL | for x in option {
| ^^^^^^
|
= note: `-D clippy::for-loop-over-option` implied by `-D warnings`
@ -10,7 +10,7 @@ error: for loop over `option`, which is an `Option`. This is more readably writt
error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement.
--> $DIR/for_loop_over_option_result.rs:25:14
|
25 | for x in result {
LL | for x in result {
| ^^^^^^
|
= note: `-D clippy::for-loop-over-result` implied by `-D warnings`
@ -19,7 +19,7 @@ error: for loop over `result`, which is a `Result`. This is more readably writte
error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
--> $DIR/for_loop_over_option_result.rs:29:14
|
29 | for x in option.ok_or("x not found") {
LL | for x in option.ok_or("x not found") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
@ -27,7 +27,7 @@ error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
--> $DIR/for_loop_over_option_result.rs:35:14
|
35 | for x in v.iter().next() {
LL | for x in v.iter().next() {
| ^^^^^^^^^^^^^^^
|
= note: #[deny(clippy::iter_next_loop)] on by default
@ -35,7 +35,7 @@ error: you are iterating over `Iterator::next()` which is an Option; this will c
error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This is more readably written as an `if let` statement.
--> $DIR/for_loop_over_option_result.rs:40:14
|
40 | for x in v.iter().next().and(Some(0)) {
LL | for x in v.iter().next().and(Some(0)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
@ -43,7 +43,7 @@ error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This
error: for loop over `v.iter().next().ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
--> $DIR/for_loop_over_option_result.rs:44:14
|
44 | for x in v.iter().next().ok_or("x not found") {
LL | for x in v.iter().next().ok_or("x not found") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider replacing `for x in v.iter().next().ok_or("x not found")` with `if let Ok(x) = v.iter().next().ok_or("x not found")`
@ -51,10 +51,10 @@ error: for loop over `v.iter().next().ok_or("x not found")`, which is a `Result`
error: this loop never actually loops
--> $DIR/for_loop_over_option_result.rs:56:5
|
56 | / while let Some(x) = option {
57 | | println!("{}", x);
58 | | break;
59 | | }
LL | / while let Some(x) = option {
LL | | println!("{}", x);
LL | | break;
LL | | }
| |_____^
|
= note: #[deny(clippy::never_loop)] on by default
@ -62,10 +62,10 @@ error: this loop never actually loops
error: this loop never actually loops
--> $DIR/for_loop_over_option_result.rs:62:5
|
62 | / while let Ok(x) = result {
63 | | println!("{}", x);
64 | | break;
65 | | }
LL | / while let Ok(x) = result {
LL | | println!("{}", x);
LL | | break;
LL | | }
| |_____^
error: aborting due to 8 previous errors

View File

@ -1,7 +1,7 @@
error: useless use of `format!`
--> $DIR/format.rs:21:5
|
21 | format!("foo");
LL | format!("foo");
| ^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string()`
|
= note: `-D clippy::useless-format` implied by `-D warnings`
@ -9,7 +9,7 @@ error: useless use of `format!`
error: useless use of `format!`
--> $DIR/format.rs:23:5
|
23 | format!("{}", "foo");
LL | format!("{}", "foo");
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string()`
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
@ -17,7 +17,7 @@ error: useless use of `format!`
error: useless use of `format!`
--> $DIR/format.rs:27:5
|
27 | format!("{:+}", "foo"); // warn when the format makes no difference
LL | format!("{:+}", "foo"); // warn when the format makes no difference
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string()`
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
@ -25,7 +25,7 @@ error: useless use of `format!`
error: useless use of `format!`
--> $DIR/format.rs:28:5
|
28 | format!("{:<}", "foo"); // warn when the format makes no difference
LL | format!("{:<}", "foo"); // warn when the format makes no difference
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string()`
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
@ -33,7 +33,7 @@ error: useless use of `format!`
error: useless use of `format!`
--> $DIR/format.rs:33:5
|
33 | format!("{}", arg);
LL | format!("{}", arg);
| ^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `arg.to_string()`
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
@ -41,7 +41,7 @@ error: useless use of `format!`
error: useless use of `format!`
--> $DIR/format.rs:37:5
|
37 | format!("{:+}", arg); // warn when the format makes no difference
LL | format!("{:+}", arg); // warn when the format makes no difference
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `arg.to_string()`
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
@ -49,7 +49,7 @@ error: useless use of `format!`
error: useless use of `format!`
--> $DIR/format.rs:38:5
|
38 | format!("{:<}", arg); // warn when the format makes no difference
LL | format!("{:<}", arg); // warn when the format makes no difference
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `arg.to_string()`
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
@ -57,7 +57,7 @@ error: useless use of `format!`
error: useless use of `format!`
--> $DIR/format.rs:65:5
|
65 | format!("{}", 42.to_string());
LL | format!("{}", 42.to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `to_string()` is enough: `42.to_string()`
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
@ -65,7 +65,7 @@ error: useless use of `format!`
error: useless use of `format!`
--> $DIR/format.rs:67:5
|
67 | format!("{}", x.display().to_string());
LL | format!("{}", x.display().to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `to_string()` is enough: `x.display().to_string()`
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

View File

@ -1,7 +1,7 @@
error: this looks like an `else {..}` but the `else` is missing
--> $DIR/formatting.rs:21:6
|
21 | } {
LL | } {
| ^
|
= note: `-D clippy::suspicious-else-formatting` implied by `-D warnings`
@ -10,7 +10,7 @@ error: this looks like an `else {..}` but the `else` is missing
error: this looks like an `else if` but the `else` is missing
--> $DIR/formatting.rs:25:6
|
25 | } if foo() {
LL | } if foo() {
| ^
|
= note: to remove this lint, add the missing `else` or add a new line before the second `if`
@ -18,7 +18,7 @@ error: this looks like an `else if` but the `else` is missing
error: this looks like an `else if` but the `else` is missing
--> $DIR/formatting.rs:32:10
|
32 | } if foo() {
LL | } if foo() {
| ^
|
= note: to remove this lint, add the missing `else` or add a new line before the second `if`
@ -26,7 +26,7 @@ error: this looks like an `else if` but the `else` is missing
error: this looks like an `else if` but the `else` is missing
--> $DIR/formatting.rs:40:10
|
40 | } if foo() {
LL | } if foo() {
| ^
|
= note: to remove this lint, add the missing `else` or add a new line before the second `if`
@ -34,9 +34,9 @@ error: this looks like an `else if` but the `else` is missing
error: this is an `else {..}` but the formatting might hide it
--> $DIR/formatting.rs:49:6
|
49 | } else
LL | } else
| ______^
50 | | {
LL | | {
| |____^
|
= note: to remove this lint, remove the `else` or remove the new line between `else` and `{..}`
@ -44,10 +44,10 @@ error: this is an `else {..}` but the formatting might hide it
error: this is an `else {..}` but the formatting might hide it
--> $DIR/formatting.rs:54:6
|
54 | }
LL | }
| ______^
55 | | else
56 | | {
LL | | else
LL | | {
| |____^
|
= note: to remove this lint, remove the `else` or remove the new line between `else` and `{..}`
@ -55,9 +55,9 @@ error: this is an `else {..}` but the formatting might hide it
error: this is an `else if` but the formatting might hide it
--> $DIR/formatting.rs:60:6
|
60 | } else
LL | } else
| ______^
61 | | if foo() { // the span of the above error should continue here
LL | | if foo() { // the span of the above error should continue here
| |____^
|
= note: to remove this lint, remove the `else` or remove the new line between `else` and `if`
@ -65,55 +65,55 @@ error: this is an `else if` but the formatting might hide it
error: this is an `else if` but the formatting might hide it
--> $DIR/formatting.rs:65:6
|
65 | }
LL | }
| ______^
66 | | else
67 | | if foo() { // the span of the above error should continue here
LL | | else
LL | | if foo() { // the span of the above error should continue here
| |____^
|
= note: to remove this lint, remove the `else` or remove the new line between `else` and `if`
error: this looks like you are trying to use `.. -= ..`, but you really are doing `.. = (- ..)`
--> $DIR/formatting.rs:106:6
|
106 | a =- 35;
| ^^^^
|
= note: `-D clippy::suspicious-assignment-formatting` implied by `-D warnings`
= note: to remove this lint, use either `-=` or `= -`
--> $DIR/formatting.rs:106:6
|
LL | a =- 35;
| ^^^^
|
= note: `-D clippy::suspicious-assignment-formatting` implied by `-D warnings`
= note: to remove this lint, use either `-=` or `= -`
error: this looks like you are trying to use `.. *= ..`, but you really are doing `.. = (* ..)`
--> $DIR/formatting.rs:107:6
|
107 | a =* &191;
| ^^^^
|
= note: to remove this lint, use either `*=` or `= *`
--> $DIR/formatting.rs:107:6
|
LL | a =* &191;
| ^^^^
|
= note: to remove this lint, use either `*=` or `= *`
error: this looks like you are trying to use `.. != ..`, but you really are doing `.. = (! ..)`
--> $DIR/formatting.rs:110:6
|
110 | b =! false;
| ^^^^
|
= note: to remove this lint, use either `!=` or `= !`
--> $DIR/formatting.rs:110:6
|
LL | b =! false;
| ^^^^
|
= note: to remove this lint, use either `!=` or `= !`
error: possibly missing a comma here
--> $DIR/formatting.rs:119:19
|
119 | -1, -2, -3 // <= no comma here
| ^
|
= note: `-D clippy::possible-missing-comma` implied by `-D warnings`
= note: to remove this lint, add a comma or write the expr in a single line
--> $DIR/formatting.rs:119:19
|
LL | -1, -2, -3 // <= no comma here
| ^
|
= note: `-D clippy::possible-missing-comma` implied by `-D warnings`
= note: to remove this lint, add a comma or write the expr in a single line
error: possibly missing a comma here
--> $DIR/formatting.rs:123:19
|
123 | -1, -2, -3 // <= no comma here
| ^
|
= note: to remove this lint, add a comma or write the expr in a single line
--> $DIR/formatting.rs:123:19
|
LL | -1, -2, -3 // <= no comma here
| ^
|
= note: to remove this lint, add a comma or write the expr in a single line
error: aborting due to 13 previous errors

View File

@ -1,7 +1,7 @@
error: this function has too many arguments (8/7)
--> $DIR/functions.rs:17:1
|
17 | fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
LL | fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::too-many-arguments` implied by `-D warnings`
@ -9,19 +9,19 @@ error: this function has too many arguments (8/7)
error: this function has too many arguments (8/7)
--> $DIR/functions.rs:34:5
|
34 | fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ());
LL | fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this function has too many arguments (8/7)
--> $DIR/functions.rs:43:5
|
43 | fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
LL | fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> $DIR/functions.rs:52:34
|
52 | println!("{}", unsafe { *p });
LL | println!("{}", unsafe { *p });
| ^
|
= note: `-D clippy::not-unsafe-ptr-arg-deref` implied by `-D warnings`
@ -29,49 +29,49 @@ error: this public function dereferences a raw pointer but is not marked `unsafe
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> $DIR/functions.rs:53:35
|
53 | println!("{:?}", unsafe { p.as_ref() });
LL | println!("{:?}", unsafe { p.as_ref() });
| ^
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> $DIR/functions.rs:54:33
|
54 | unsafe { std::ptr::read(p) };
LL | unsafe { std::ptr::read(p) };
| ^
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> $DIR/functions.rs:65:30
|
65 | println!("{}", unsafe { *p });
LL | println!("{}", unsafe { *p });
| ^
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> $DIR/functions.rs:66:31
|
66 | println!("{:?}", unsafe { p.as_ref() });
LL | println!("{:?}", unsafe { p.as_ref() });
| ^
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> $DIR/functions.rs:67:29
|
67 | unsafe { std::ptr::read(p) };
LL | unsafe { std::ptr::read(p) };
| ^
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> $DIR/functions.rs:76:34
|
76 | println!("{}", unsafe { *p });
LL | println!("{}", unsafe { *p });
| ^
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> $DIR/functions.rs:77:35
|
77 | println!("{:?}", unsafe { p.as_ref() });
LL | println!("{:?}", unsafe { p.as_ref() });
| ^
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> $DIR/functions.rs:78:33
|
78 | unsafe { std::ptr::read(p) };
LL | unsafe { std::ptr::read(p) };
| ^
error: aborting due to 12 previous errors

View File

@ -1,7 +1,7 @@
error: Prefer FxHashMap over HashMap, it has better performance and we don't need any collision prevention in clippy
--> $DIR/fxhash.rs:16:24
|
16 | use std::collections::{HashMap, HashSet};
LL | use std::collections::{HashMap, HashSet};
| ^^^^^^^ help: use: `FxHashMap`
|
= note: `-D clippy::default-hash-types` implied by `-D warnings`
@ -9,31 +9,31 @@ error: Prefer FxHashMap over HashMap, it has better performance and we don't nee
error: Prefer FxHashSet over HashSet, it has better performance and we don't need any collision prevention in clippy
--> $DIR/fxhash.rs:16:33
|
16 | use std::collections::{HashMap, HashSet};
LL | use std::collections::{HashMap, HashSet};
| ^^^^^^^ help: use: `FxHashSet`
error: Prefer FxHashMap over HashMap, it has better performance and we don't need any collision prevention in clippy
--> $DIR/fxhash.rs:19:15
|
19 | let _map: HashMap<String, String> = HashMap::default();
LL | let _map: HashMap<String, String> = HashMap::default();
| ^^^^^^^ help: use: `FxHashMap`
error: Prefer FxHashMap over HashMap, it has better performance and we don't need any collision prevention in clippy
--> $DIR/fxhash.rs:19:41
|
19 | let _map: HashMap<String, String> = HashMap::default();
LL | let _map: HashMap<String, String> = HashMap::default();
| ^^^^^^^ help: use: `FxHashMap`
error: Prefer FxHashSet over HashSet, it has better performance and we don't need any collision prevention in clippy
--> $DIR/fxhash.rs:20:15
|
20 | let _set: HashSet<String> = HashSet::default();
LL | let _set: HashSet<String> = HashSet::default();
| ^^^^^^^ help: use: `FxHashSet`
error: Prefer FxHashSet over HashSet, it has better performance and we don't need any collision prevention in clippy
--> $DIR/fxhash.rs:20:33
|
20 | let _set: HashSet<String> = HashSet::default();
LL | let _set: HashSet<String> = HashSet::default();
| ^^^^^^^ help: use: `FxHashSet`
error: aborting due to 6 previous errors

View File

@ -1,7 +1,7 @@
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:41:17
|
41 | let _ = boxed_slice.get(1).unwrap();
LL | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
|
= note: `-D clippy::get-unwrap` implied by `-D warnings`
@ -9,67 +9,67 @@ error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more co
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:42:17
|
42 | let _ = some_slice.get(0).unwrap();
LL | let _ = some_slice.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:43:17
|
43 | let _ = some_vec.get(0).unwrap();
LL | let _ = some_vec.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:44:17
|
44 | let _ = some_vecdeque.get(0).unwrap();
LL | let _ = some_vecdeque.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:45:17
|
45 | let _ = some_hashmap.get(&1).unwrap();
LL | let _ = some_hashmap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:46:17
|
46 | let _ = some_btreemap.get(&1).unwrap();
LL | let _ = some_btreemap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:52:10
|
52 | *boxed_slice.get_mut(0).unwrap() = 1;
LL | *boxed_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut boxed_slice[0]`
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:53:10
|
53 | *some_slice.get_mut(0).unwrap() = 1;
LL | *some_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_slice[0]`
error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:54:10
|
54 | *some_vec.get_mut(0).unwrap() = 1;
LL | *some_vec.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vec[0]`
error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:55:10
|
55 | *some_vecdeque.get_mut(0).unwrap() = 1;
LL | *some_vecdeque.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vecdeque[0]`
error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:64:17
|
64 | let _ = some_vec.get(0..1).unwrap().to_vec();
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:65:17
|
65 | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
error: aborting due to 12 previous errors

View File

@ -1,13 +1,13 @@
error: you don't need to add `&` to both the expression and the patterns
--> $DIR/ice-2636.rs:21:9
|
21 | / match $foo {
22 | | $ ( & $t => $ord,
23 | | )*
24 | | };
LL | / match $foo {
LL | | $ ( & $t => $ord,
LL | | )*
LL | | };
| |_________^
...
30 | test_hash!(&a, A => 0, B => 1, C => 2);
LL | test_hash!(&a, A => 0, B => 1, C => 2);
| --------------------------------------- in this macro invocation
|
= note: `-D clippy::match-ref-pats` implied by `-D warnings`

View File

@ -1,67 +1,67 @@
error: identical conversion
--> $DIR/identity_conversion.rs:13:13
|
13 | let _ = T::from(val);
LL | let _ = T::from(val);
| ^^^^^^^^^^^^ help: consider removing `T::from()`: `val`
|
note: lint level defined here
--> $DIR/identity_conversion.rs:10:9
|
10 | #![deny(clippy::identity_conversion)]
LL | #![deny(clippy::identity_conversion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: identical conversion
--> $DIR/identity_conversion.rs:14:5
|
14 | val.into()
LL | val.into()
| ^^^^^^^^^^ help: consider removing `.into()`: `val`
error: identical conversion
--> $DIR/identity_conversion.rs:26:22
|
26 | let _: i32 = 0i32.into();
LL | let _: i32 = 0i32.into();
| ^^^^^^^^^^^ help: consider removing `.into()`: `0i32`
error: identical conversion
--> $DIR/identity_conversion.rs:47:21
|
47 | let _: String = "foo".to_string().into();
LL | let _: String = "foo".to_string().into();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
error: identical conversion
--> $DIR/identity_conversion.rs:48:21
|
48 | let _: String = From::from("foo".to_string());
LL | let _: String = From::from("foo".to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
error: identical conversion
--> $DIR/identity_conversion.rs:49:13
|
49 | let _ = String::from("foo".to_string());
LL | let _ = String::from("foo".to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`
error: identical conversion
--> $DIR/identity_conversion.rs:50:13
|
50 | let _ = String::from(format!("A: {:04}", 123));
LL | let _ = String::from(format!("A: {:04}", 123));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("A: {:04}", 123)`
error: identical conversion
--> $DIR/identity_conversion.rs:51:13
|
51 | let _ = "".lines().into_iter();
LL | let _ = "".lines().into_iter();
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `"".lines()`
error: identical conversion
--> $DIR/identity_conversion.rs:52:13
|
52 | let _ = vec![1, 2, 3].into_iter().into_iter();
LL | let _ = vec![1, 2, 3].into_iter().into_iter();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![1, 2, 3].into_iter()`
error: identical conversion
--> $DIR/identity_conversion.rs:53:21
|
53 | let _: String = format!("Hello {}", "world").into();
LL | let _: String = format!("Hello {}", "world").into();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("Hello {}", "world")`
error: aborting due to 10 previous errors

View File

@ -1,7 +1,7 @@
error: the operation is ineffective. Consider reducing it to `x`
--> $DIR/identity_op.rs:25:5
|
25 | x + 0;
LL | x + 0;
| ^^^^^
|
= note: `-D clippy::identity-op` implied by `-D warnings`
@ -9,43 +9,43 @@ error: the operation is ineffective. Consider reducing it to `x`
error: the operation is ineffective. Consider reducing it to `x`
--> $DIR/identity_op.rs:26:5
|
26 | x + (1 - 1);
LL | x + (1 - 1);
| ^^^^^^^^^^^
error: the operation is ineffective. Consider reducing it to `x`
--> $DIR/identity_op.rs:28:5
|
28 | 0 + x;
LL | 0 + x;
| ^^^^^
error: the operation is ineffective. Consider reducing it to `x`
--> $DIR/identity_op.rs:31:5
|
31 | x | (0);
LL | x | (0);
| ^^^^^^^
error: the operation is ineffective. Consider reducing it to `x`
--> $DIR/identity_op.rs:34:5
|
34 | x * 1;
LL | x * 1;
| ^^^^^
error: the operation is ineffective. Consider reducing it to `x`
--> $DIR/identity_op.rs:35:5
|
35 | 1 * x;
LL | 1 * x;
| ^^^^^
error: the operation is ineffective. Consider reducing it to `x`
--> $DIR/identity_op.rs:41:5
|
41 | -1 & x;
LL | -1 & x;
| ^^^^^^
error: the operation is ineffective. Consider reducing it to `u`
--> $DIR/identity_op.rs:44:5
|
44 | u & 255;
LL | u & 255;
| ^^^^^^^
error: aborting due to 8 previous errors

View File

@ -1,11 +1,11 @@
error: Unnecessary boolean `not` operation
--> $DIR/if_not_else.rs:18:5
|
18 | / if !bla() {
19 | | println!("Bugs");
20 | | } else {
21 | | println!("Bunny");
22 | | }
LL | / if !bla() {
LL | | println!("Bugs");
LL | | } else {
LL | | println!("Bunny");
LL | | }
| |_____^
|
= note: `-D clippy::if-not-else` implied by `-D warnings`
@ -14,11 +14,11 @@ error: Unnecessary boolean `not` operation
error: Unnecessary `!=` operation
--> $DIR/if_not_else.rs:23:5
|
23 | / if 4 != 5 {
24 | | println!("Bugs");
25 | | } else {
26 | | println!("Bunny");
27 | | }
LL | / if 4 != 5 {
LL | | println!("Bugs");
LL | | } else {
LL | | println!("Bunny");
LL | | }
| |_____^
|
= help: change to `==` and swap the blocks of the if/else

View File

@ -1,34 +1,34 @@
error: Multiple implementations of this structure
--> $DIR/impl.rs:19:1
|
19 | / impl MyStruct {
20 | | fn second() {}
21 | | }
LL | / impl MyStruct {
LL | | fn second() {}
LL | | }
| |_^
|
= note: `-D clippy::multiple-inherent-impl` implied by `-D warnings`
note: First implementation here
--> $DIR/impl.rs:15:1
|
15 | / impl MyStruct {
16 | | fn first() {}
17 | | }
LL | / impl MyStruct {
LL | | fn first() {}
LL | | }
| |_^
error: Multiple implementations of this structure
--> $DIR/impl.rs:33:5
|
33 | / impl super::MyStruct {
34 | | fn third() {}
35 | | }
LL | / impl super::MyStruct {
LL | | fn third() {}
LL | | }
| |_____^
|
note: First implementation here
--> $DIR/impl.rs:15:1
|
15 | / impl MyStruct {
16 | | fn first() {}
17 | | }
LL | / impl MyStruct {
LL | | fn first() {}
LL | | }
| |_^
error: aborting due to 2 previous errors

View File

@ -1,136 +1,136 @@
error: impl for `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:20:35
|
20 | impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> {
LL | impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> {
| ^^^^^^^^^^^^^
|
= note: `-D clippy::implicit-hasher` implied by `-D warnings`
help: consider adding a type parameter
|
20 | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashMap<K, V, S> {
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashMap<K, V, S> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
help: ...and use generic constructor
|
26 | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: impl for `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:29:36
|
29 | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
LL | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
| ^^^^^^^^^^^^^
help: consider adding a type parameter
|
29 | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) {
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
help: ...and use generic constructor
|
31 | ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
LL | ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: impl for `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:34:19
|
34 | impl Foo<i16> for HashMap<String, String> {
LL | impl Foo<i16> for HashMap<String, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^
help: consider adding a type parameter
|
34 | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: ...and use generic constructor
|
36 | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: impl for `HashSet` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:51:32
|
51 | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
LL | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
| ^^^^^^^^^^
help: consider adding a type parameter
|
51 | impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
LL | impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
help: ...and use generic constructor
|
53 | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
LL | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: impl for `HashSet` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:56:19
|
56 | impl Foo<i16> for HashSet<String> {
LL | impl Foo<i16> for HashSet<String> {
| ^^^^^^^^^^^^^^^
help: consider adding a type parameter
|
56 | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
help: ...and use generic constructor
|
58 | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
LL | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: parameter of type `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:73:23
|
73 | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
| ^^^^^^^^^^^^^^^^^
help: consider adding a type parameter
|
73 | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
error: parameter of type `HashSet` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:73:53
|
73 | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
| ^^^^^^^^^^^^
help: consider adding a type parameter
|
73 | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
error: impl for `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:77:43
|
77 | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
| ^^^^^^^^^^^^^
...
89 | gen!(impl);
LL | gen!(impl);
| ----------- in this macro invocation
help: consider adding a type parameter
|
77 | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
help: ...and use generic constructor
|
79 | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: parameter of type `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:85:33
|
85 | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
| ^^^^^^^^^^^^^^^^^
...
90 | gen!(fn bar);
LL | gen!(fn bar);
| ------------- in this macro invocation
help: consider adding a type parameter
|
85 | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
error: parameter of type `HashSet` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:85:63
|
85 | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
| ^^^^^^^^^^^^
...
90 | gen!(fn bar);
LL | gen!(fn bar);
| ------------- in this macro invocation
help: consider adding a type parameter
|
85 | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
error: aborting due to 10 previous errors

View File

@ -1,7 +1,7 @@
error: missing return statement
--> $DIR/implicit_return.rs:17:5
|
17 | true
LL | true
| ^^^^ help: add `return` as shown: `return true`
|
= note: `-D clippy::implicit-return` implied by `-D warnings`
@ -9,55 +9,55 @@ error: missing return statement
error: missing return statement
--> $DIR/implicit_return.rs:23:9
|
23 | true
LL | true
| ^^^^ help: add `return` as shown: `return true`
error: missing return statement
--> $DIR/implicit_return.rs:25:9
|
25 | false
LL | false
| ^^^^^ help: add `return` as shown: `return false`
error: missing return statement
--> $DIR/implicit_return.rs:33:17
|
33 | true => false,
LL | true => false,
| ^^^^^ help: add `return` as shown: `return false`
error: missing return statement
--> $DIR/implicit_return.rs:34:20
|
34 | false => { true },
LL | false => { true },
| ^^^^ help: add `return` as shown: `return true`
error: missing return statement
--> $DIR/implicit_return.rs:41:9
|
41 | break true;
LL | break true;
| ^^^^^^^^^^ help: change `break` to `return` as shown: `return true`
error: missing return statement
--> $DIR/implicit_return.rs:49:13
|
49 | break true;
LL | break true;
| ^^^^^^^^^^ help: change `break` to `return` as shown: `return true`
error: missing return statement
--> $DIR/implicit_return.rs:58:13
|
58 | break true;
LL | break true;
| ^^^^^^^^^^ help: change `break` to `return` as shown: `return true`
error: missing return statement
--> $DIR/implicit_return.rs:67:18
|
67 | let _ = || { true };
LL | let _ = || { true };
| ^^^^ help: add `return` as shown: `return true`
error: missing return statement
--> $DIR/implicit_return.rs:68:16
|
68 | let _ = || true;
LL | let _ = || true;
| ^^^^ help: add `return` as shown: `return true`
error: aborting due to 10 previous errors

View File

@ -1,7 +1,7 @@
error: digits grouped inconsistently by underscores
--> $DIR/inconsistent_digit_grouping.rs:22:16
|
22 | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
| ^^^^^^^^ help: consider: `123_456`
|
= note: `-D clippy::inconsistent-digit-grouping` implied by `-D warnings`
@ -9,25 +9,25 @@ error: digits grouped inconsistently by underscores
error: digits grouped inconsistently by underscores
--> $DIR/inconsistent_digit_grouping.rs:22:26
|
22 | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
| ^^^^^^^^^^ help: consider: `12_345_678`
error: digits grouped inconsistently by underscores
--> $DIR/inconsistent_digit_grouping.rs:22:38
|
22 | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
| ^^^^^^^^ help: consider: `1_234_567`
error: digits grouped inconsistently by underscores
--> $DIR/inconsistent_digit_grouping.rs:22:48
|
22 | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
| ^^^^^^^^^^^^^^ help: consider: `1_234.567_8_f32`
error: digits grouped inconsistently by underscores
--> $DIR/inconsistent_digit_grouping.rs:22:64
|
22 | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
| ^^^^^^^^^^^^^^ help: consider: `1.234_567_8_f32`
error: aborting due to 5 previous errors

View File

@ -1,7 +1,7 @@
error: index out of bounds: the len is 4 but the index is 4
--> $DIR/indexing_slicing.rs:25:5
|
25 | x[4]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
LL | x[4]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
| ^^^^
|
= note: #[deny(const_err)] on by default
@ -9,25 +9,25 @@ error: index out of bounds: the len is 4 but the index is 4
error: index out of bounds: the len is 4 but the index is 8
--> $DIR/indexing_slicing.rs:26:5
|
26 | x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
LL | x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
| ^^^^^^^^^
error: index out of bounds: the len is 0 but the index is 0
--> $DIR/indexing_slicing.rs:56:5
|
56 | empty[0]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
LL | empty[0]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
| ^^^^^^^^
error: index out of bounds: the len is 4 but the index is 15
--> $DIR/indexing_slicing.rs:87:5
|
87 | x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
LL | x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
| ^^^^
error: indexing may panic.
--> $DIR/indexing_slicing.rs:20:5
|
20 | x[index];
LL | x[index];
| ^^^^^^^^
|
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
@ -36,7 +36,7 @@ error: indexing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:21:6
|
21 | &x[index..];
LL | &x[index..];
| ^^^^^^^^^^
|
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
@ -44,7 +44,7 @@ error: slicing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:22:6
|
22 | &x[..index];
LL | &x[..index];
| ^^^^^^^^^^
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
@ -52,7 +52,7 @@ error: slicing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:23:6
|
23 | &x[index_from..index_to];
LL | &x[index_from..index_to];
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
@ -60,7 +60,7 @@ error: slicing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:24:6
|
24 | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
@ -68,7 +68,7 @@ error: slicing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:24:6
|
24 | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
| ^^^^^^^^^^^^^^^
|
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
@ -76,7 +76,7 @@ error: slicing may panic.
error: range is out of bounds
--> $DIR/indexing_slicing.rs:27:11
|
27 | &x[..=4];
LL | &x[..=4];
| ^
|
= note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
@ -84,13 +84,13 @@ error: range is out of bounds
error: range is out of bounds
--> $DIR/indexing_slicing.rs:28:11
|
28 | &x[1..5];
LL | &x[1..5];
| ^
error: slicing may panic.
--> $DIR/indexing_slicing.rs:29:6
|
29 | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
LL | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
| ^^^^^^^^^^^^
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
@ -98,37 +98,37 @@ error: slicing may panic.
error: range is out of bounds
--> $DIR/indexing_slicing.rs:29:8
|
29 | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
LL | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:30:8
|
30 | &x[5..];
LL | &x[5..];
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:31:10
|
31 | &x[..5];
LL | &x[..5];
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:32:8
|
32 | &x[5..].iter().map(|x| 2 * x).collect::<Vec<i32>>();
LL | &x[5..].iter().map(|x| 2 * x).collect::<Vec<i32>>();
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:33:12
|
33 | &x[0..=4];
LL | &x[0..=4];
| ^
error: slicing may panic.
--> $DIR/indexing_slicing.rs:34:6
|
34 | &x[0..][..3];
LL | &x[0..][..3];
| ^^^^^^^^^^^
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
@ -136,7 +136,7 @@ error: slicing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:35:6
|
35 | &x[1..][..5];
LL | &x[1..][..5];
| ^^^^^^^^^^^
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
@ -144,7 +144,7 @@ error: slicing may panic.
error: indexing may panic.
--> $DIR/indexing_slicing.rs:48:5
|
48 | y[0];
LL | y[0];
| ^^^^
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
@ -152,7 +152,7 @@ error: indexing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:49:6
|
49 | &y[1..2];
LL | &y[1..2];
| ^^^^^^^
|
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
@ -160,7 +160,7 @@ error: slicing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:50:6
|
50 | &y[0..=4];
LL | &y[0..=4];
| ^^^^^^^^
|
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
@ -168,7 +168,7 @@ error: slicing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:51:6
|
51 | &y[..=4];
LL | &y[..=4];
| ^^^^^^^
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
@ -176,49 +176,49 @@ error: slicing may panic.
error: range is out of bounds
--> $DIR/indexing_slicing.rs:57:12
|
57 | &empty[1..5];
LL | &empty[1..5];
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:58:16
|
58 | &empty[0..=4];
LL | &empty[0..=4];
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:59:15
|
59 | &empty[..=4];
LL | &empty[..=4];
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:60:12
|
60 | &empty[1..];
LL | &empty[1..];
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:61:14
|
61 | &empty[..4];
LL | &empty[..4];
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:62:16
|
62 | &empty[0..=0];
LL | &empty[0..=0];
| ^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:63:15
|
63 | &empty[..=0];
LL | &empty[..=0];
| ^
error: indexing may panic.
--> $DIR/indexing_slicing.rs:71:5
|
71 | v[0];
LL | v[0];
| ^^^^
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
@ -226,7 +226,7 @@ error: indexing may panic.
error: indexing may panic.
--> $DIR/indexing_slicing.rs:72:5
|
72 | v[10];
LL | v[10];
| ^^^^^
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
@ -234,7 +234,7 @@ error: indexing may panic.
error: indexing may panic.
--> $DIR/indexing_slicing.rs:73:5
|
73 | v[1 << 3];
LL | v[1 << 3];
| ^^^^^^^^^
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
@ -242,7 +242,7 @@ error: indexing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:74:6
|
74 | &v[10..100];
LL | &v[10..100];
| ^^^^^^^^^^
|
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
@ -250,7 +250,7 @@ error: slicing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:75:6
|
75 | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
| ^^^^^^^^^^^^^^
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
@ -258,13 +258,13 @@ error: slicing may panic.
error: range is out of bounds
--> $DIR/indexing_slicing.rs:75:8
|
75 | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
| ^^
error: slicing may panic.
--> $DIR/indexing_slicing.rs:76:6
|
76 | &v[10..];
LL | &v[10..];
| ^^^^^^^
|
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
@ -272,7 +272,7 @@ error: slicing may panic.
error: slicing may panic.
--> $DIR/indexing_slicing.rs:77:6
|
77 | &v[..100];
LL | &v[..100];
| ^^^^^^^^
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
@ -280,7 +280,7 @@ error: slicing may panic.
error: indexing may panic.
--> $DIR/indexing_slicing.rs:89:5
|
89 | v[N];
LL | v[N];
| ^^^^
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
@ -288,7 +288,7 @@ error: indexing may panic.
error: indexing may panic.
--> $DIR/indexing_slicing.rs:90:5
|
90 | v[M];
LL | v[M];
| ^^^^
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
@ -296,13 +296,13 @@ error: indexing may panic.
error: range is out of bounds
--> $DIR/indexing_slicing.rs:94:13
|
94 | &x[num..10]; // should trigger out of bounds error
LL | &x[num..10]; // should trigger out of bounds error
| ^^
error: range is out of bounds
--> $DIR/indexing_slicing.rs:95:8
|
95 | &x[10..num]; // should trigger out of bounds error
LL | &x[10..num]; // should trigger out of bounds error
| ^^
error: aborting due to 43 previous errors

View File

@ -1,9 +1,9 @@
error: you seem to be trying to use match to destructure a single infallible pattern. Consider using `let`
--> $DIR/infallible_destructuring_match.rs:25:5
|
25 | / let data = match wrapper {
26 | | SingleVariantEnum::Variant(i) => i,
27 | | };
LL | / let data = match wrapper {
LL | | SingleVariantEnum::Variant(i) => i,
LL | | };
| |______^ help: try this: `let SingleVariantEnum::Variant(data) = wrapper;`
|
= note: `-D clippy::infallible-destructuring-match` implied by `-D warnings`
@ -11,17 +11,17 @@ error: you seem to be trying to use match to destructure a single infallible pat
error: you seem to be trying to use match to destructure a single infallible pattern. Consider using `let`
--> $DIR/infallible_destructuring_match.rs:46:5
|
46 | / let data = match wrapper {
47 | | TupleStruct(i) => i,
48 | | };
LL | / let data = match wrapper {
LL | | TupleStruct(i) => i,
LL | | };
| |______^ help: try this: `let TupleStruct(data) = wrapper;`
error: you seem to be trying to use match to destructure a single infallible pattern. Consider using `let`
--> $DIR/infallible_destructuring_match.rs:67:5
|
67 | / let data = match wrapper {
68 | | Ok(i) => i,
69 | | };
LL | / let data = match wrapper {
LL | | Ok(i) => i,
LL | | };
| |______^ help: try this: `let Ok(data) = wrapper;`
error: aborting due to 3 previous errors

View File

@ -1,7 +1,7 @@
error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
--> $DIR/infinite_iter.rs:19:5
|
19 | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
LL | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unused-collect` implied by `-D warnings`
@ -9,100 +9,100 @@ error: you are collect()ing an iterator and throwing away the result. Consider u
error: infinite iteration detected
--> $DIR/infinite_iter.rs:19:5
|
19 | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
LL | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/infinite_iter.rs:17:8
|
17 | #[deny(clippy::infinite_iter)]
LL | #[deny(clippy::infinite_iter)]
| ^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:20:5
|
20 | (0..8_u32).take_while(square_is_lower_64).cycle().count(); // infinite iter
LL | (0..8_u32).take_while(square_is_lower_64).cycle().count(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:21:5
|
21 | (0..8_u64).chain(0..).max(); // infinite iter
LL | (0..8_u64).chain(0..).max(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:26:5
|
26 | / (0..8_u32)
27 | | .rev()
28 | | .cycle()
29 | | .map(|x| x + 1_u32)
30 | | .for_each(|x| println!("{}", x)); // infinite iter
LL | / (0..8_u32)
LL | | .rev()
LL | | .cycle()
LL | | .map(|x| x + 1_u32)
LL | | .for_each(|x| println!("{}", x)); // infinite iter
| |________________________________________^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:32:5
|
32 | (0_usize..).flat_map(|x| 0..x).product::<usize>(); // infinite iter
LL | (0_usize..).flat_map(|x| 0..x).product::<usize>(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:33:5
|
33 | (0_u64..).filter(|x| x % 2 == 0).last(); // infinite iter
LL | (0_u64..).filter(|x| x % 2 == 0).last(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:40:5
|
40 | (0..).zip((0..).take_while(square_is_lower_64)).count(); // maybe infinite iter
LL | (0..).zip((0..).take_while(square_is_lower_64)).count(); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/infinite_iter.rs:38:8
|
38 | #[deny(clippy::maybe_infinite_iter)]
LL | #[deny(clippy::maybe_infinite_iter)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:41:5
|
41 | repeat(42).take_while(|x| *x == 42).chain(0..42).max(); // maybe infinite iter
LL | repeat(42).take_while(|x| *x == 42).chain(0..42).max(); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:42:5
|
42 | / (1..)
43 | | .scan(0, |state, x| {
44 | | *state += x;
45 | | Some(*state)
46 | | })
47 | | .min(); // maybe infinite iter
LL | / (1..)
LL | | .scan(0, |state, x| {
LL | | *state += x;
LL | | Some(*state)
LL | | })
LL | | .min(); // maybe infinite iter
| |______________^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:48:5
|
48 | (0..).find(|x| *x == 24); // maybe infinite iter
LL | (0..).find(|x| *x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:49:5
|
49 | (0..).position(|x| x == 24); // maybe infinite iter
LL | (0..).position(|x| x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:50:5
|
50 | (0..).any(|x| x == 24); // maybe infinite iter
LL | (0..).any(|x| x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:51:5
|
51 | (0..).all(|x| x == 24); // maybe infinite iter
LL | (0..).all(|x| x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 14 previous errors

View File

@ -1,7 +1,7 @@
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
--> $DIR/infinite_loop.rs:32:11
|
32 | while y < 10 {
LL | while y < 10 {
| ^^^^^^
|
= note: #[deny(clippy::while_immutable_condition)] on by default
@ -9,50 +9,50 @@ error: Variable in the condition are not mutated in the loop body. This either l
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
--> $DIR/infinite_loop.rs:37:11
|
37 | while y < 10 && x < 3 {
LL | while y < 10 && x < 3 {
| ^^^^^^^^^^^^^^^
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
--> $DIR/infinite_loop.rs:44:11
|
44 | while !cond {
LL | while !cond {
| ^^^^^
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
--> $DIR/infinite_loop.rs:88:11
|
88 | while i < 3 {
LL | while i < 3 {
| ^^^^^
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
--> $DIR/infinite_loop.rs:93:11
|
93 | while i < 3 && j > 0 {
LL | while i < 3 && j > 0 {
| ^^^^^^^^^^^^^^
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
--> $DIR/infinite_loop.rs:97:11
|
97 | while i < 3 {
LL | while i < 3 {
| ^^^^^
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
--> $DIR/infinite_loop.rs:112:11
|
112 | while i < 3 {
| ^^^^^
--> $DIR/infinite_loop.rs:112:11
|
LL | while i < 3 {
| ^^^^^
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
--> $DIR/infinite_loop.rs:117:11
|
117 | while i < 3 {
| ^^^^^
--> $DIR/infinite_loop.rs:117:11
|
LL | while i < 3 {
| ^^^^^
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
--> $DIR/infinite_loop.rs:183:15
|
183 | while self.count < n {
| ^^^^^^^^^^^^^^
--> $DIR/infinite_loop.rs:183:15
|
LL | while self.count < n {
| ^^^^^^^^^^^^^^
error: aborting due to 9 previous errors

View File

@ -1,9 +1,9 @@
error: use of `#[inline]` on trait method `default_inline` which has no body
--> $DIR/inline_fn_without_body.rs:14:5
|
14 | #[inline]
LL | #[inline]
| _____-^^^^^^^^
15 | | fn default_inline();
LL | | fn default_inline();
| |____- help: remove
|
= note: `-D clippy::inline-fn-without-body` implied by `-D warnings`
@ -11,17 +11,17 @@ error: use of `#[inline]` on trait method `default_inline` which has no body
error: use of `#[inline]` on trait method `always_inline` which has no body
--> $DIR/inline_fn_without_body.rs:17:5
|
17 | #[inline(always)]
LL | #[inline(always)]
| _____-^^^^^^^^^^^^^^^^
18 | | fn always_inline();
LL | | fn always_inline();
| |____- help: remove
error: use of `#[inline]` on trait method `never_inline` which has no body
--> $DIR/inline_fn_without_body.rs:20:5
|
20 | #[inline(never)]
LL | #[inline(never)]
| _____-^^^^^^^^^^^^^^^
21 | | fn never_inline();
LL | | fn never_inline();
| |____- help: remove
error: aborting due to 3 previous errors

View File

@ -1,43 +1,43 @@
error: Unnecessary `>= y + 1` or `x - 1 >=`
--> $DIR/int_plus_one.rs:16:5
|
16 | x >= y + 1;
LL | x >= y + 1;
| ^^^^^^^^^^
|
= note: `-D clippy::int-plus-one` implied by `-D warnings`
help: change `>= y + 1` to `> y` as shown
|
16 | x > y;
LL | x > y;
| ^^^^^
error: Unnecessary `>= y + 1` or `x - 1 >=`
--> $DIR/int_plus_one.rs:17:5
|
17 | y + 1 <= x;
LL | y + 1 <= x;
| ^^^^^^^^^^
help: change `>= y + 1` to `> y` as shown
|
17 | y < x;
LL | y < x;
| ^^^^^
error: Unnecessary `>= y + 1` or `x - 1 >=`
--> $DIR/int_plus_one.rs:19:5
|
19 | x - 1 >= y;
LL | x - 1 >= y;
| ^^^^^^^^^^
help: change `>= y + 1` to `> y` as shown
|
19 | x > y;
LL | x > y;
| ^^^^^
error: Unnecessary `>= y + 1` or `x - 1 >=`
--> $DIR/int_plus_one.rs:20:5
|
20 | y <= x - 1;
LL | y <= x - 1;
| ^^^^^^^^^^
help: change `>= y + 1` to `> y` as shown
|
20 | y < x;
LL | y < x;
| ^^^^^
error: aborting due to 4 previous errors

View File

@ -1,25 +1,25 @@
error: this .into_iter() call is equivalent to .iter() and will not move the array
--> $DIR/into_iter_on_ref.rs:11:24
|
11 | for _ in [1, 2, 3].into_iter() {} //~ ERROR equivalent to .iter()
LL | for _ in [1, 2, 3].into_iter() {} //~ ERROR equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
|
note: lint level defined here
--> $DIR/into_iter_on_ref.rs:2:9
|
2 | #![deny(clippy::into_iter_on_array)]
LL | #![deny(clippy::into_iter_on_array)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this .into_iter() call is equivalent to .iter() and will not move the array
--> $DIR/into_iter_on_ref.rs:13:23
|
13 | let _ = [1, 2, 3].into_iter(); //~ ERROR equivalent to .iter()
LL | let _ = [1, 2, 3].into_iter(); //~ ERROR equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter() and will not move the Vec
--> $DIR/into_iter_on_ref.rs:15:30
|
15 | let _ = (&vec![1, 2, 3]).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&vec![1, 2, 3]).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
|
= note: `-D clippy::into-iter-on-ref` implied by `-D warnings`
@ -27,151 +27,151 @@ error: this .into_iter() call is equivalent to .iter() and will not move the Vec
error: this .into_iter() call is equivalent to .iter() and will not move the slice
--> $DIR/into_iter_on_ref.rs:16:46
|
16 | let _ = vec![1, 2, 3].into_boxed_slice().into_iter(); //~ WARN equivalent to .iter()
LL | let _ = vec![1, 2, 3].into_boxed_slice().into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter() and will not move the slice
--> $DIR/into_iter_on_ref.rs:17:41
|
17 | let _ = std::rc::Rc::from(&[X][..]).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = std::rc::Rc::from(&[X][..]).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter() and will not move the slice
--> $DIR/into_iter_on_ref.rs:18:44
|
18 | let _ = std::sync::Arc::from(&[X][..]).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = std::sync::Arc::from(&[X][..]).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter() and will not move the array
--> $DIR/into_iter_on_ref.rs:20:32
|
20 | let _ = (&&&&&&&[1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter()
LL | let _ = (&&&&&&&[1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter() and will not move the array
--> $DIR/into_iter_on_ref.rs:21:36
|
21 | let _ = (&&&&mut &&&[1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter()
LL | let _ = (&&&&mut &&&[1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter_mut() and will not move the array
--> $DIR/into_iter_on_ref.rs:22:40
|
22 | let _ = (&mut &mut &mut [1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter_mut()
LL | let _ = (&mut &mut &mut [1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter_mut()
| ^^^^^^^^^ help: call directly: `iter_mut`
error: this .into_iter() call is equivalent to .iter() and will not move the Option
--> $DIR/into_iter_on_ref.rs:24:24
|
24 | let _ = (&Some(4)).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&Some(4)).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter_mut() and will not move the Option
--> $DIR/into_iter_on_ref.rs:25:28
|
25 | let _ = (&mut Some(5)).into_iter(); //~ WARN equivalent to .iter_mut()
LL | let _ = (&mut Some(5)).into_iter(); //~ WARN equivalent to .iter_mut()
| ^^^^^^^^^ help: call directly: `iter_mut`
error: this .into_iter() call is equivalent to .iter() and will not move the Result
--> $DIR/into_iter_on_ref.rs:26:32
|
26 | let _ = (&Ok::<_, i32>(6)).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&Ok::<_, i32>(6)).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter_mut() and will not move the Result
--> $DIR/into_iter_on_ref.rs:27:37
|
27 | let _ = (&mut Err::<i32, _>(7)).into_iter(); //~ WARN equivalent to .iter_mut()
LL | let _ = (&mut Err::<i32, _>(7)).into_iter(); //~ WARN equivalent to .iter_mut()
| ^^^^^^^^^ help: call directly: `iter_mut`
error: this .into_iter() call is equivalent to .iter() and will not move the Vec
--> $DIR/into_iter_on_ref.rs:28:34
|
28 | let _ = (&Vec::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&Vec::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter_mut() and will not move the Vec
--> $DIR/into_iter_on_ref.rs:29:38
|
29 | let _ = (&mut Vec::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
LL | let _ = (&mut Vec::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
| ^^^^^^^^^ help: call directly: `iter_mut`
error: this .into_iter() call is equivalent to .iter() and will not move the BTreeMap
--> $DIR/into_iter_on_ref.rs:30:44
|
30 | let _ = (&BTreeMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&BTreeMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter_mut() and will not move the BTreeMap
--> $DIR/into_iter_on_ref.rs:31:48
|
31 | let _ = (&mut BTreeMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
LL | let _ = (&mut BTreeMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
| ^^^^^^^^^ help: call directly: `iter_mut`
error: this .into_iter() call is equivalent to .iter() and will not move the VecDeque
--> $DIR/into_iter_on_ref.rs:32:39
|
32 | let _ = (&VecDeque::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&VecDeque::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter_mut() and will not move the VecDeque
--> $DIR/into_iter_on_ref.rs:33:43
|
33 | let _ = (&mut VecDeque::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
LL | let _ = (&mut VecDeque::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
| ^^^^^^^^^ help: call directly: `iter_mut`
error: this .into_iter() call is equivalent to .iter() and will not move the LinkedList
--> $DIR/into_iter_on_ref.rs:34:41
|
34 | let _ = (&LinkedList::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&LinkedList::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter_mut() and will not move the LinkedList
--> $DIR/into_iter_on_ref.rs:35:45
|
35 | let _ = (&mut LinkedList::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
LL | let _ = (&mut LinkedList::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
| ^^^^^^^^^ help: call directly: `iter_mut`
error: this .into_iter() call is equivalent to .iter() and will not move the HashMap
--> $DIR/into_iter_on_ref.rs:36:43
|
36 | let _ = (&HashMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&HashMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter_mut() and will not move the HashMap
--> $DIR/into_iter_on_ref.rs:37:47
|
37 | let _ = (&mut HashMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
LL | let _ = (&mut HashMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
| ^^^^^^^^^ help: call directly: `iter_mut`
error: this .into_iter() call is equivalent to .iter() and will not move the BTreeSet
--> $DIR/into_iter_on_ref.rs:39:39
|
39 | let _ = (&BTreeSet::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&BTreeSet::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter() and will not move the BinaryHeap
--> $DIR/into_iter_on_ref.rs:40:41
|
40 | let _ = (&BinaryHeap::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&BinaryHeap::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter() and will not move the HashSet
--> $DIR/into_iter_on_ref.rs:41:38
|
41 | let _ = (&HashSet::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
LL | let _ = (&HashSet::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter() and will not move the Path
--> $DIR/into_iter_on_ref.rs:42:43
|
42 | let _ = std::path::Path::new("12/34").into_iter(); //~ WARN equivalent to .iter()
LL | let _ = std::path::Path::new("12/34").into_iter(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: this .into_iter() call is equivalent to .iter() and will not move the PathBuf
--> $DIR/into_iter_on_ref.rs:43:47
|
43 | let _ = std::path::PathBuf::from("12/34").into_iter(); //~ ERROR equivalent to .iter()
LL | let _ = std::path::PathBuf::from("12/34").into_iter(); //~ ERROR equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`
error: aborting due to 28 previous errors

View File

@ -1,7 +1,7 @@
error: reference to zeroed memory
--> $DIR/invalid_ref.rs:33:24
|
33 | let ref_zero: &T = std::mem::zeroed(); // warning
LL | let ref_zero: &T = std::mem::zeroed(); // warning
| ^^^^^^^^^^^^^^^^^^
|
= note: #[deny(clippy::invalid_ref)] on by default
@ -10,7 +10,7 @@ error: reference to zeroed memory
error: reference to zeroed memory
--> $DIR/invalid_ref.rs:37:24
|
37 | let ref_zero: &T = core::mem::zeroed(); // warning
LL | let ref_zero: &T = core::mem::zeroed(); // warning
| ^^^^^^^^^^^^^^^^^^^
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
@ -18,7 +18,7 @@ error: reference to zeroed memory
error: reference to zeroed memory
--> $DIR/invalid_ref.rs:41:24
|
41 | let ref_zero: &T = std::intrinsics::init(); // warning
LL | let ref_zero: &T = std::intrinsics::init(); // warning
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
@ -26,7 +26,7 @@ error: reference to zeroed memory
error: reference to uninitialized memory
--> $DIR/invalid_ref.rs:45:26
|
45 | let ref_uninit: &T = std::mem::uninitialized(); // warning
LL | let ref_uninit: &T = std::mem::uninitialized(); // warning
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
@ -34,7 +34,7 @@ error: reference to uninitialized memory
error: reference to uninitialized memory
--> $DIR/invalid_ref.rs:49:26
|
49 | let ref_uninit: &T = core::mem::uninitialized(); // warning
LL | let ref_uninit: &T = core::mem::uninitialized(); // warning
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
@ -42,7 +42,7 @@ error: reference to uninitialized memory
error: reference to uninitialized memory
--> $DIR/invalid_ref.rs:53:26
|
53 | let ref_uninit: &T = std::intrinsics::uninit(); // warning
LL | let ref_uninit: &T = std::intrinsics::uninit(); // warning
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html

View File

@ -1,7 +1,7 @@
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:30:5
|
30 | (u8 as u32) > 300;
LL | (u8 as u32) > 300;
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::invalid-upcast-comparisons` implied by `-D warnings`
@ -9,157 +9,157 @@ error: because of the numeric bounds on `u8` prior to casting, this expression i
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:31:5
|
31 | (u8 as i32) > 300;
LL | (u8 as i32) > 300;
| ^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:32:5
|
32 | (u8 as u32) == 300;
LL | (u8 as u32) == 300;
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:33:5
|
33 | (u8 as i32) == 300;
LL | (u8 as i32) == 300;
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:34:5
|
34 | 300 < (u8 as u32);
LL | 300 < (u8 as u32);
| ^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:35:5
|
35 | 300 < (u8 as i32);
LL | 300 < (u8 as i32);
| ^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:36:5
|
36 | 300 == (u8 as u32);
LL | 300 == (u8 as u32);
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:37:5
|
37 | 300 == (u8 as i32);
LL | 300 == (u8 as i32);
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:39:5
|
39 | (u8 as u32) <= 300;
LL | (u8 as u32) <= 300;
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:40:5
|
40 | (u8 as i32) <= 300;
LL | (u8 as i32) <= 300;
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:41:5
|
41 | (u8 as u32) != 300;
LL | (u8 as u32) != 300;
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:42:5
|
42 | (u8 as i32) != 300;
LL | (u8 as i32) != 300;
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:43:5
|
43 | 300 >= (u8 as u32);
LL | 300 >= (u8 as u32);
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:44:5
|
44 | 300 >= (u8 as i32);
LL | 300 >= (u8 as i32);
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:45:5
|
45 | 300 != (u8 as u32);
LL | 300 != (u8 as u32);
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:46:5
|
46 | 300 != (u8 as i32);
LL | 300 != (u8 as i32);
| ^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:49:5
|
49 | (u8 as i32) < 0;
LL | (u8 as i32) < 0;
| ^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:50:5
|
50 | -5 != (u8 as i32);
LL | -5 != (u8 as i32);
| ^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:52:5
|
52 | (u8 as i32) >= 0;
LL | (u8 as i32) >= 0;
| ^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:53:5
|
53 | -5 == (u8 as i32);
LL | -5 == (u8 as i32);
| ^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:56:5
|
56 | 1337 == (u8 as i32);
LL | 1337 == (u8 as i32);
| ^^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:57:5
|
57 | 1337 == (u8 as u32);
LL | 1337 == (u8 as u32);
| ^^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:59:5
|
59 | 1337 != (u8 as i32);
LL | 1337 != (u8 as i32);
| ^^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:60:5
|
60 | 1337 != (u8 as u32);
LL | 1337 != (u8 as u32);
| ^^^^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
--> $DIR/invalid_upcast_comparisons.rs:74:5
|
74 | (u8 as i32) > -1;
LL | (u8 as i32) > -1;
| ^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:75:5
|
75 | (u8 as i32) < -1;
LL | (u8 as i32) < -1;
| ^^^^^^^^^^^^^^^^
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
--> $DIR/invalid_upcast_comparisons.rs:91:5
|
91 | -5 >= (u8 as i32);
LL | -5 >= (u8 as i32);
| ^^^^^^^^^^^^^^^^^
error: aborting due to 27 previous errors

View File

@ -1,7 +1,7 @@
error: expected token: `,`
--> $DIR/issue-3145.rs:11:19
|
11 | println!("{}" a); //~ERROR expected token: `,`
LL | println!("{}" a); //~ERROR expected token: `,`
| ^
error: aborting due to previous error

View File

@ -1,13 +1,13 @@
error: this loop could be written as a `for` loop
--> $DIR/issue_2356.rs:24:29
|
24 | while let Some(e) = it.next() {
LL | while let Some(e) = it.next() {
| ^^^^^^^^^ help: try: `for e in it { .. }`
|
note: lint level defined here
--> $DIR/issue_2356.rs:10:9
|
10 | #![deny(clippy::while_let_on_iterator)]
LL | #![deny(clippy::while_let_on_iterator)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -1,9 +1,9 @@
error: adding items after statements is confusing, since items exist from the start of the scope
--> $DIR/item_after_statement.rs:21:5
|
21 | / fn foo() {
22 | | println!("foo");
23 | | }
LL | / fn foo() {
LL | | println!("foo");
LL | | }
| |_____^
|
= note: `-D clippy::items-after-statements` implied by `-D warnings`
@ -11,9 +11,9 @@ error: adding items after statements is confusing, since items exist from the st
error: adding items after statements is confusing, since items exist from the start of the scope
--> $DIR/item_after_statement.rs:28:5
|
28 | / fn foo() {
29 | | println!("foo");
30 | | }
LL | / fn foo() {
LL | | println!("foo");
LL | | }
| |_____^
error: aborting due to 2 previous errors

View File

@ -1,7 +1,7 @@
error: digit groups should be smaller
--> $DIR/large_digit_groups.rs:24:9
|
24 | 0b1_10110_i64,
LL | 0b1_10110_i64,
| ^^^^^^^^^^^^^ help: consider: `0b11_0110_i64`
|
= note: `-D clippy::large-digit-groups` implied by `-D warnings`
@ -9,31 +9,31 @@ error: digit groups should be smaller
error: digit groups should be smaller
--> $DIR/large_digit_groups.rs:25:9
|
25 | 0x1_23456_78901_usize,
LL | 0x1_23456_78901_usize,
| ^^^^^^^^^^^^^^^^^^^^^ help: consider: `0x0123_4567_8901_usize`
error: digit groups should be smaller
--> $DIR/large_digit_groups.rs:26:9
|
26 | 1_23456_f32,
LL | 1_23456_f32,
| ^^^^^^^^^^^ help: consider: `123_456_f32`
error: digit groups should be smaller
--> $DIR/large_digit_groups.rs:27:9
|
27 | 1_23456.12_f32,
LL | 1_23456.12_f32,
| ^^^^^^^^^^^^^^ help: consider: `123_456.12_f32`
error: digit groups should be smaller
--> $DIR/large_digit_groups.rs:28:9
|
28 | 1_23456.12345_f32,
LL | 1_23456.12345_f32,
| ^^^^^^^^^^^^^^^^^ help: consider: `123_456.123_45_f32`
error: digit groups should be smaller
--> $DIR/large_digit_groups.rs:29:9
|
29 | 1_23456.12345_6_f32,
LL | 1_23456.12345_6_f32,
| ^^^^^^^^^^^^^^^^^^^ help: consider: `123_456.123_456_f32`
error: aborting due to 6 previous errors

Some files were not shown because too many files have changed in this diff Show More