error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:10:5
+ --> absurd-extreme-comparisons.rs:10:5
|
10 | u <= 0;
| ^^^^^^
= help: because 0 is the minimum value for this type, the case where the two sides are not equal never occurs, consider using u == 0 instead
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:11:5
+ --> absurd-extreme-comparisons.rs:11:5
|
11 | 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
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:12:5
+ --> absurd-extreme-comparisons.rs:12:5
|
12 | u < Z;
| ^^^^^
= help: because Z is the minimum value for this type, this comparison is always false
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:13:5
+ --> absurd-extreme-comparisons.rs:13:5
|
13 | 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
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:14:5
+ --> absurd-extreme-comparisons.rs:14:5
|
14 | Z > u;
| ^^^^^
= help: because Z is the minimum value for this type, this comparison is always false
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:15:5
+ --> absurd-extreme-comparisons.rs:15:5
|
15 | u > std::u32::MAX;
| ^^^^^^^^^^^^^^^^^
= help: because std::u32::MAX is the maximum value for this type, this comparison is always false
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:16:5
+ --> absurd-extreme-comparisons.rs:16:5
|
16 | 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
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:17:5
+ --> absurd-extreme-comparisons.rs:17:5
|
17 | std::u32::MAX < u;
| ^^^^^^^^^^^^^^^^^
= help: because std::u32::MAX is the maximum value for this type, this comparison is always false
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:18:5
+ --> absurd-extreme-comparisons.rs:18:5
|
18 | 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
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:19:5
+ --> absurd-extreme-comparisons.rs:19:5
|
19 | 1-1 > u;
| ^^^^^^^
= help: because 1-1 is the minimum value for this type, this comparison is always false
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:20:5
+ --> absurd-extreme-comparisons.rs:20:5
|
20 | 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
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:21:5
+ --> absurd-extreme-comparisons.rs:21:5
|
21 | 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
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:23:5
+ --> absurd-extreme-comparisons.rs:23:5
|
23 | i < -127 - 1;
| ^^^^^^^^^^^^
= help: because -127 - 1 is the minimum value for this type, this comparison is always false
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:24:5
+ --> absurd-extreme-comparisons.rs:24:5
|
24 | std::i8::MAX >= i;
| ^^^^^^^^^^^^^^^^^
= help: because std::i8::MAX is the maximum value for this type, this comparison is always true
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:25:5
+ --> absurd-extreme-comparisons.rs:25:5
|
25 | 3-7 < std::i32::MIN;
| ^^^^^^^^^^^^^^^^^^^
= help: because std::i32::MIN is the minimum value for this type, this comparison is always false
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:27:5
+ --> absurd-extreme-comparisons.rs:27:5
|
27 | 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
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
- --> examples/absurd-extreme-comparisons.rs:28:5
+ --> absurd-extreme-comparisons.rs:28:5
|
28 | false > b;
| ^^^^^^^^^
= help: because false is the minimum value for this type, this comparison is always false
error: <-comparison of unit values detected. This will always be false
- --> examples/absurd-extreme-comparisons.rs:31:5
+ --> absurd-extreme-comparisons.rs:31:5
|
31 | () < {};
| ^^^^^^^
error: approximate value of `f{32, 64}::consts::E` found. Consider using it directly
- --> examples/approx_const.rs:7:16
+ --> approx_const.rs:7:16
|
7 | let my_e = 2.7182;
| ^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::E` found. Consider using it directly
- --> examples/approx_const.rs:8:20
+ --> approx_const.rs:8:20
|
8 | let almost_e = 2.718;
| ^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_1_PI` found. Consider using it directly
- --> examples/approx_const.rs:11:24
+ --> approx_const.rs:11:24
|
11 | let my_1_frac_pi = 0.3183;
| ^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found. Consider using it directly
- --> examples/approx_const.rs:14:28
+ --> approx_const.rs:14:28
|
14 | let my_frac_1_sqrt_2 = 0.70710678;
| ^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_1_SQRT_2` found. Consider using it directly
- --> examples/approx_const.rs:15:32
+ --> approx_const.rs:15:32
|
15 | let almost_frac_1_sqrt_2 = 0.70711;
| ^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_2_PI` found. Consider using it directly
- --> examples/approx_const.rs:18:24
+ --> approx_const.rs:18:24
|
18 | let my_frac_2_pi = 0.63661977;
| ^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_2_SQRT_PI` found. Consider using it directly
- --> examples/approx_const.rs:21:27
+ --> approx_const.rs:21:27
|
21 | let my_frac_2_sq_pi = 1.128379;
| ^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_PI_2` found. Consider using it directly
- --> examples/approx_const.rs:24:24
+ --> approx_const.rs:24:24
|
24 | let my_frac_pi_2 = 1.57079632679;
| ^^^^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_PI_3` found. Consider using it directly
- --> examples/approx_const.rs:27:24
+ --> approx_const.rs:27:24
|
27 | let my_frac_pi_3 = 1.04719755119;
| ^^^^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_PI_4` found. Consider using it directly
- --> examples/approx_const.rs:30:24
+ --> approx_const.rs:30:24
|
30 | let my_frac_pi_4 = 0.785398163397;
| ^^^^^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_PI_6` found. Consider using it directly
- --> examples/approx_const.rs:33:24
+ --> approx_const.rs:33:24
|
33 | let my_frac_pi_6 = 0.523598775598;
| ^^^^^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::FRAC_PI_8` found. Consider using it directly
- --> examples/approx_const.rs:36:24
+ --> approx_const.rs:36:24
|
36 | let my_frac_pi_8 = 0.3926990816987;
| ^^^^^^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::LN_10` found. Consider using it directly
- --> examples/approx_const.rs:39:20
+ --> approx_const.rs:39:20
|
39 | let my_ln_10 = 2.302585092994046;
| ^^^^^^^^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::LN_2` found. Consider using it directly
- --> examples/approx_const.rs:42:19
+ --> approx_const.rs:42:19
|
42 | let my_ln_2 = 0.6931471805599453;
| ^^^^^^^^^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::LOG10_E` found. Consider using it directly
- --> examples/approx_const.rs:45:22
+ --> approx_const.rs:45:22
|
45 | let my_log10_e = 0.43429448190325182;
| ^^^^^^^^^^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::LOG2_E` found. Consider using it directly
- --> examples/approx_const.rs:48:21
+ --> approx_const.rs:48:21
|
48 | let my_log2_e = 1.4426950408889634;
| ^^^^^^^^^^^^^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly
- --> examples/approx_const.rs:51:17
+ --> approx_const.rs:51:17
|
51 | let my_pi = 3.1415;
| ^^^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly
- --> examples/approx_const.rs:52:21
+ --> approx_const.rs:52:21
|
52 | let almost_pi = 3.14;
| ^^^^
= note: `-D approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::SQRT_2` found. Consider using it directly
- --> examples/approx_const.rs:55:18
+ --> approx_const.rs:55:18
|
55 | let my_sq2 = 1.4142;
| ^^^^^^
error: integer arithmetic detected
- --> examples/arithmetic.rs:8:5
+ --> arithmetic.rs:8:5
|
8 | 1 + i;
| ^^^^^
= note: `-D integer-arithmetic` implied by `-D warnings`
error: integer arithmetic detected
- --> examples/arithmetic.rs:9:5
+ --> arithmetic.rs:9:5
|
9 | i * 2;
| ^^^^^
= note: `-D integer-arithmetic` implied by `-D warnings`
error: integer arithmetic detected
- --> examples/arithmetic.rs:10:5
+ --> arithmetic.rs:10:5
|
10 | / 1 %
11 | | i / 2; // no error, this is part of the expression in the preceding line
= note: `-D integer-arithmetic` implied by `-D warnings`
error: integer arithmetic detected
- --> examples/arithmetic.rs:12:5
+ --> arithmetic.rs:12:5
|
12 | i - 2 + 2 - i;
| ^^^^^^^^^^^^^
= note: `-D integer-arithmetic` implied by `-D warnings`
error: integer arithmetic detected
- --> examples/arithmetic.rs:13:5
+ --> arithmetic.rs:13:5
|
13 | -i;
| ^^
= note: `-D integer-arithmetic` implied by `-D warnings`
error: floating-point arithmetic detected
- --> examples/arithmetic.rs:23:5
+ --> arithmetic.rs:23:5
|
23 | f * 2.0;
| ^^^^^^^
= note: `-D float-arithmetic` implied by `-D warnings`
error: floating-point arithmetic detected
- --> examples/arithmetic.rs:25:5
+ --> arithmetic.rs:25:5
|
25 | 1.0 + f;
| ^^^^^^^
= note: `-D float-arithmetic` implied by `-D warnings`
error: floating-point arithmetic detected
- --> examples/arithmetic.rs:26:5
+ --> arithmetic.rs:26:5
|
26 | f * 2.0;
| ^^^^^^^
= note: `-D float-arithmetic` implied by `-D warnings`
error: floating-point arithmetic detected
- --> examples/arithmetic.rs:27:5
+ --> arithmetic.rs:27:5
|
27 | f / 2.0;
| ^^^^^^^
= note: `-D float-arithmetic` implied by `-D warnings`
error: floating-point arithmetic detected
- --> examples/arithmetic.rs:28:5
+ --> arithmetic.rs:28:5
|
28 | f - 2.0 * 4.2;
| ^^^^^^^^^^^^^
= note: `-D float-arithmetic` implied by `-D warnings`
error: floating-point arithmetic detected
- --> examples/arithmetic.rs:29:5
+ --> arithmetic.rs:29:5
|
29 | -f;
| ^^
error: const index is out of bounds
- --> examples/array_indexing.rs:12:5
+ --> array_indexing.rs:12:5
|
12 | x[4];
| ^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: const index is out of bounds
- --> examples/array_indexing.rs:13:5
+ --> array_indexing.rs:13:5
|
13 | x[1 << 3];
| ^^^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:14:6
+ --> array_indexing.rs:14:6
|
14 | &x[1..5];
| ^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:16:6
+ --> array_indexing.rs:16:6
|
16 | &x[0...4];
| ^^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:17:6
+ --> array_indexing.rs:17:6
|
17 | &x[...4];
| ^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:21:6
+ --> array_indexing.rs:21:6
|
21 | &x[5..];
| ^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:23:6
+ --> array_indexing.rs:23:6
|
23 | &x[..5];
| ^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: indexing may panic
- --> examples/array_indexing.rs:26:5
+ --> array_indexing.rs:26:5
|
26 | y[0];
| ^^^^
= note: `-D indexing-slicing` implied by `-D warnings`
error: slicing may panic
- --> examples/array_indexing.rs:27:6
+ --> array_indexing.rs:27:6
|
27 | &y[1..2];
| ^^^^^^^
= note: `-D indexing-slicing` implied by `-D warnings`
error: slicing may panic
- --> examples/array_indexing.rs:29:6
+ --> array_indexing.rs:29:6
|
29 | &y[0...4];
| ^^^^^^^^
= note: `-D indexing-slicing` implied by `-D warnings`
error: slicing may panic
- --> examples/array_indexing.rs:30:6
+ --> array_indexing.rs:30:6
|
30 | &y[...4];
| ^^^^^^^
= note: `-D indexing-slicing` implied by `-D warnings`
error: const index is out of bounds
- --> examples/array_indexing.rs:33:5
+ --> array_indexing.rs:33:5
|
33 | empty[0];
| ^^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:34:6
+ --> array_indexing.rs:34:6
|
34 | &empty[1..5];
| ^^^^^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:35:6
+ --> array_indexing.rs:35:6
|
35 | &empty[0...4];
| ^^^^^^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:36:6
+ --> array_indexing.rs:36:6
|
36 | &empty[...4];
| ^^^^^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:40:6
+ --> array_indexing.rs:40:6
|
40 | &empty[0...0];
| ^^^^^^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:41:6
+ --> array_indexing.rs:41:6
|
41 | &empty[...0];
| ^^^^^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:43:6
+ --> array_indexing.rs:43:6
|
43 | &empty[1..];
| ^^^^^^^^^^
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
- --> examples/array_indexing.rs:44:6
+ --> array_indexing.rs:44:6
|
44 | &empty[..4];
| ^^^^^^^^^^
error: assign operation detected
- --> examples/assign_ops.rs:8:5
+ --> assign_ops.rs:8:5
|
8 | i += 2;
| ^^^^^^ help: replace it with `i = i + 2`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:9:5
+ --> assign_ops.rs:9:5
|
9 | i += 2 + 17;
| ^^^^^^^^^^^ help: replace it with `i = i + 2 + 17`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:10:5
+ --> assign_ops.rs:10:5
|
10 | i -= 6;
| ^^^^^^ help: replace it with `i = i - 6`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:11:5
+ --> assign_ops.rs:11:5
|
11 | i -= 2 - 1;
| ^^^^^^^^^^ help: replace it with `i = i - (2 - 1)`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:12:5
+ --> assign_ops.rs:12:5
|
12 | i *= 5;
| ^^^^^^ help: replace it with `i = i * 5`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:13:5
+ --> assign_ops.rs:13:5
|
13 | i *= 1+5;
| ^^^^^^^^ help: replace it with `i = i * (1+5)`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:14:5
+ --> assign_ops.rs:14:5
|
14 | i /= 32;
| ^^^^^^^ help: replace it with `i = i / 32`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:15:5
+ --> assign_ops.rs:15:5
|
15 | i /= 32 | 5;
| ^^^^^^^^^^^ help: replace it with `i = i / (32 | 5)`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:16:5
+ --> assign_ops.rs:16:5
|
16 | i /= 32 / 5;
| ^^^^^^^^^^^ help: replace it with `i = i / (32 / 5)`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:17:5
+ --> assign_ops.rs:17:5
|
17 | i %= 42;
| ^^^^^^^ help: replace it with `i = i % 42`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:18:5
+ --> assign_ops.rs:18:5
|
18 | i >>= i;
| ^^^^^^^ help: replace it with `i = i >> i`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:19:5
+ --> assign_ops.rs:19:5
|
19 | i <<= 9 + 6 - 7;
| ^^^^^^^^^^^^^^^ help: replace it with `i = i << (9 + 6 - 7)`
= note: `-D assign-ops` implied by `-D warnings`
error: assign operation detected
- --> examples/assign_ops.rs:20:5
+ --> assign_ops.rs:20:5
|
20 | i += 1 << 5;
| ^^^^^^^^^^^ help: replace it with `i = i + (1 << 5)`
= note: `-D assign-ops` implied by `-D warnings`
error: manual implementation of an assign operation
- --> examples/assign_ops.rs:27:5
+ --> assign_ops.rs:27:5
|
27 | a = a + 1;
| ^^^^^^^^^ help: replace it with `a += 1`
= note: `-D assign-op-pattern` implied by `-D warnings`
error: manual implementation of an assign operation
- --> examples/assign_ops.rs:28:5
+ --> assign_ops.rs:28:5
|
28 | a = 1 + a;
| ^^^^^^^^^ help: replace it with `a += 1`
= note: `-D assign-op-pattern` implied by `-D warnings`
error: manual implementation of an assign operation
- --> examples/assign_ops.rs:29:5
+ --> assign_ops.rs:29:5
|
29 | a = a - 1;
| ^^^^^^^^^ help: replace it with `a -= 1`
= note: `-D assign-op-pattern` implied by `-D warnings`
error: manual implementation of an assign operation
- --> examples/assign_ops.rs:30:5
+ --> assign_ops.rs:30:5
|
30 | a = a * 99;
| ^^^^^^^^^^ help: replace it with `a *= 99`
= note: `-D assign-op-pattern` implied by `-D warnings`
error: manual implementation of an assign operation
- --> examples/assign_ops.rs:31:5
+ --> assign_ops.rs:31:5
|
31 | a = 42 * a;
| ^^^^^^^^^^ help: replace it with `a *= 42`
= note: `-D assign-op-pattern` implied by `-D warnings`
error: manual implementation of an assign operation
- --> examples/assign_ops.rs:32:5
+ --> assign_ops.rs:32:5
|
32 | a = a / 2;
| ^^^^^^^^^ help: replace it with `a /= 2`
= note: `-D assign-op-pattern` implied by `-D warnings`
error: manual implementation of an assign operation
- --> examples/assign_ops.rs:33:5
+ --> assign_ops.rs:33:5
|
33 | a = a % 5;
| ^^^^^^^^^ help: replace it with `a %= 5`
= note: `-D assign-op-pattern` implied by `-D warnings`
error: manual implementation of an assign operation
- --> examples/assign_ops.rs:34:5
+ --> assign_ops.rs:34:5
|
34 | a = a & 1;
| ^^^^^^^^^ help: replace it with `a &= 1`
error: variable appears on both sides of an assignment operation
- --> examples/assign_ops2.rs:8:5
+ --> assign_ops2.rs:8:5
|
8 | a += a + 1;
| ^^^^^^^^^^ help: replace it with `a += 1`
= note: `-D misrefactored-assign-op` implied by `-D warnings`
error: variable appears on both sides of an assignment operation
- --> examples/assign_ops2.rs:9:5
+ --> assign_ops2.rs:9:5
|
9 | a += 1 + a;
| ^^^^^^^^^^ help: replace it with `a += 1`
= note: `-D misrefactored-assign-op` implied by `-D warnings`
error: variable appears on both sides of an assignment operation
- --> examples/assign_ops2.rs:10:5
+ --> assign_ops2.rs:10:5
|
10 | a -= a - 1;
| ^^^^^^^^^^ help: replace it with `a -= 1`
= note: `-D misrefactored-assign-op` implied by `-D warnings`
error: variable appears on both sides of an assignment operation
- --> examples/assign_ops2.rs:11:5
+ --> assign_ops2.rs:11:5
|
11 | a *= a * 99;
| ^^^^^^^^^^^ help: replace it with `a *= 99`
= note: `-D misrefactored-assign-op` implied by `-D warnings`
error: variable appears on both sides of an assignment operation
- --> examples/assign_ops2.rs:12:5
+ --> assign_ops2.rs:12:5
|
12 | a *= 42 * a;
| ^^^^^^^^^^^ help: replace it with `a *= 42`
= note: `-D misrefactored-assign-op` implied by `-D warnings`
error: variable appears on both sides of an assignment operation
- --> examples/assign_ops2.rs:13:5
+ --> assign_ops2.rs:13:5
|
13 | a /= a / 2;
| ^^^^^^^^^^ help: replace it with `a /= 2`
= note: `-D misrefactored-assign-op` implied by `-D warnings`
error: variable appears on both sides of an assignment operation
- --> examples/assign_ops2.rs:14:5
+ --> assign_ops2.rs:14:5
|
14 | a %= a % 5;
| ^^^^^^^^^^ help: replace it with `a %= 5`
= note: `-D misrefactored-assign-op` implied by `-D warnings`
error: variable appears on both sides of an assignment operation
- --> examples/assign_ops2.rs:15:5
+ --> assign_ops2.rs:15:5
|
15 | a &= a & 1;
| ^^^^^^^^^^ help: replace it with `a &= 1`
error: you have declared `#[inline(always)]` on `test_attr_lint`. This is usually a bad idea
- --> examples/attrs.rs:6:1
+ --> attrs.rs:6:1
|
6 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
= note: `-D inline-always` implied by `-D warnings`
error: the since field must contain a semver-compliant version
- --> examples/attrs.rs:27:14
+ --> attrs.rs:27:14
|
27 | #[deprecated(since = "forever")]
| ^^^^^^^^^^^^^^^^^
= note: `-D deprecated-semver` implied by `-D warnings`
error: the since field must contain a semver-compliant version
- --> examples/attrs.rs:30:14
+ --> attrs.rs:30:14
|
30 | #[deprecated(since = "1")]
| ^^^^^^^^^^^
error: &-masking with zero
- --> examples/bit_masks.rs:12:5
+ --> bit_masks.rs:12:5
|
12 | x & 0 == 0;
| ^^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: incompatible bit mask: `_ & 2` can never be equal to `1`
- --> examples/bit_masks.rs:15:5
+ --> bit_masks.rs:15:5
|
15 | x & 2 == 1;
| ^^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: incompatible bit mask: `_ | 3` can never be equal to `2`
- --> examples/bit_masks.rs:19:5
+ --> bit_masks.rs:19:5
|
19 | x | 3 == 2;
| ^^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: incompatible bit mask: `_ & 1` will never be higher than `1`
- --> examples/bit_masks.rs:21:5
+ --> bit_masks.rs:21:5
|
21 | x & 1 > 1;
| ^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: incompatible bit mask: `_ | 2` will always be higher than `1`
- --> examples/bit_masks.rs:25:5
+ --> bit_masks.rs:25:5
|
25 | x | 2 > 1;
| ^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: incompatible bit mask: `_ & 7` can never be equal to `8`
- --> examples/bit_masks.rs:32:5
+ --> bit_masks.rs:32:5
|
32 | x & THREE_BITS == 8;
| ^^^^^^^^^^^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: incompatible bit mask: `_ | 7` will never be lower than `7`
- --> examples/bit_masks.rs:33:5
+ --> bit_masks.rs:33:5
|
33 | x | EVEN_MORE_REDIRECTION < 7;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: &-masking with zero
- --> examples/bit_masks.rs:35:5
+ --> bit_masks.rs:35:5
|
35 | 0 & x == 0;
| ^^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: incompatible bit mask: `_ | 2` will always be higher than `1`
- --> examples/bit_masks.rs:39:5
+ --> bit_masks.rs:39:5
|
39 | 1 < 2 | x;
| ^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: incompatible bit mask: `_ | 3` can never be equal to `2`
- --> examples/bit_masks.rs:40:5
+ --> bit_masks.rs:40:5
|
40 | 2 == 3 | x;
| ^^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: incompatible bit mask: `_ & 2` can never be equal to `1`
- --> examples/bit_masks.rs:41:5
+ --> bit_masks.rs:41:5
|
41 | 1 == x & 2;
| ^^^^^^^^^^
= note: `-D bad-bit-mask` implied by `-D warnings`
error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly
- --> examples/bit_masks.rs:52:5
+ --> bit_masks.rs:52:5
|
52 | x | 1 > 3;
| ^^^^^^^^^
= note: `-D ineffective-bit-mask` implied by `-D warnings`
error: ineffective bit mask: `x | 1` compared to `4`, is the same as x compared directly
- --> examples/bit_masks.rs:53:5
+ --> bit_masks.rs:53:5
|
53 | x | 1 < 4;
| ^^^^^^^^^
= note: `-D ineffective-bit-mask` implied by `-D warnings`
error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly
- --> examples/bit_masks.rs:54:5
+ --> bit_masks.rs:54:5
|
54 | x | 1 <= 3;
| ^^^^^^^^^^
= note: `-D ineffective-bit-mask` implied by `-D warnings`
error: ineffective bit mask: `x | 1` compared to `8`, is the same as x compared directly
- --> examples/bit_masks.rs:55:5
+ --> bit_masks.rs:55:5
|
55 | x | 1 >= 8;
| ^^^^^^^^^^
error: use of a blacklisted/placeholder name `foo`
- --> examples/blacklisted_name.rs:7:9
+ --> blacklisted_name.rs:7:9
|
7 | fn test(foo: ()) {}
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `foo`
- --> examples/blacklisted_name.rs:10:9
+ --> blacklisted_name.rs:10:9
|
10 | let foo = 42;
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `bar`
- --> examples/blacklisted_name.rs:11:9
+ --> blacklisted_name.rs:11:9
|
11 | let bar = 42;
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `baz`
- --> examples/blacklisted_name.rs:12:9
+ --> blacklisted_name.rs:12:9
|
12 | let baz = 42;
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `foo`
- --> examples/blacklisted_name.rs:18:10
+ --> blacklisted_name.rs:18:10
|
18 | (foo, Some(bar), baz @ Some(_)) => (),
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `bar`
- --> examples/blacklisted_name.rs:18:20
+ --> blacklisted_name.rs:18:20
|
18 | (foo, Some(bar), baz @ Some(_)) => (),
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `baz`
- --> examples/blacklisted_name.rs:18:26
+ --> blacklisted_name.rs:18:26
|
18 | (foo, Some(bar), baz @ Some(_)) => (),
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `foo`
- --> examples/blacklisted_name.rs:23:19
+ --> blacklisted_name.rs:23:19
|
23 | fn issue_1647(mut foo: u8) {
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `bar`
- --> examples/blacklisted_name.rs:24:13
+ --> blacklisted_name.rs:24:13
|
24 | let mut bar = 0;
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `baz`
- --> examples/blacklisted_name.rs:25:21
+ --> blacklisted_name.rs:25:21
|
25 | if let Some(mut baz) = Some(42) {}
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `bar`
- --> examples/blacklisted_name.rs:29:13
+ --> blacklisted_name.rs:29:13
|
29 | let ref bar = 0;
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `baz`
- --> examples/blacklisted_name.rs:30:21
+ --> blacklisted_name.rs:30:21
|
30 | if let Some(ref baz) = Some(42) {}
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `bar`
- --> examples/blacklisted_name.rs:34:17
+ --> blacklisted_name.rs:34:17
|
34 | let ref mut bar = 0;
| ^^^
= note: `-D blacklisted-name` implied by `-D warnings`
error: use of a blacklisted/placeholder name `baz`
- --> examples/blacklisted_name.rs:35:25
+ --> blacklisted_name.rs:35:25
|
35 | if let Some(ref mut baz) = Some(42) {}
| ^^^
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'
- --> examples/block_in_if_condition.rs:30:8
+ --> block_in_if_condition.rs:30:8
|
30 | if {
| ________^
} ...
error: omit braces around single expression condition
- --> examples/block_in_if_condition.rs:41:8
+ --> block_in_if_condition.rs:41:8
|
41 | if { true } {
| ^^^^^^^^
} ...
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'
- --> examples/block_in_if_condition.rs:58:49
+ --> block_in_if_condition.rs:58:49
|
58 | if v == 3 && sky == "blue" && predicate(|x| { let target = 3; x == target }, v) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D block-in-if-condition-stmt` implied by `-D warnings`
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'
- --> examples/block_in_if_condition.rs:61:22
+ --> block_in_if_condition.rs:61:22
|
61 | if predicate(|x| { let target = 3; x == target }, v) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D block-in-if-condition-stmt` implied by `-D warnings`
error: this boolean expression can be simplified
- --> examples/block_in_if_condition.rs:67:8
+ --> block_in_if_condition.rs:67:8
|
67 | if true && x == 3 {
| ^^^^^^^^^^^^^^ help: try `x == 3`
error: equality checks against true are unnecessary
- --> examples/bool_comparison.rs:7:8
+ --> bool_comparison.rs:7:8
|
7 | if x == true { "yes" } else { "no" };
| ^^^^^^^^^ help: try simplifying it as shown: `x`
= note: `-D bool-comparison` implied by `-D warnings`
error: equality checks against false can be replaced by a negation
- --> examples/bool_comparison.rs:8:8
+ --> bool_comparison.rs:8:8
|
8 | if x == false { "yes" } else { "no" };
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
= note: `-D bool-comparison` implied by `-D warnings`
error: equality checks against true are unnecessary
- --> examples/bool_comparison.rs:9:8
+ --> bool_comparison.rs:9:8
|
9 | if true == x { "yes" } else { "no" };
| ^^^^^^^^^ help: try simplifying it as shown: `x`
= note: `-D bool-comparison` implied by `-D warnings`
error: equality checks against false can be replaced by a negation
- --> examples/bool_comparison.rs:10:8
+ --> bool_comparison.rs:10:8
|
10 | if false == x { "yes" } else { "no" };
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
error: this boolean expression contains a logic bug
- --> examples/booleans.rs:12:13
+ --> booleans.rs:12:13
|
12 | let _ = a && b || a;
| ^^^^^^^^^^^ help: it would look like the following `a`
|
= note: `-D logic-bug` implied by `-D warnings`
help: this expression can be optimized out by applying boolean operations to the outer expression
- --> examples/booleans.rs:12:18
+ --> booleans.rs:12:18
|
12 | let _ = a && b || a;
| ^
error: this boolean expression can be simplified
- --> examples/booleans.rs:14:13
+ --> booleans.rs:14:13
|
14 | let _ = !true;
| ^^^^^ help: try `false`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
- --> examples/booleans.rs:15:13
+ --> booleans.rs:15:13
|
15 | let _ = !false;
| ^^^^^^ help: try `true`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
- --> examples/booleans.rs:16:13
+ --> booleans.rs:16:13
|
16 | let _ = !!a;
| ^^^ help: try `a`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression contains a logic bug
- --> examples/booleans.rs:17:13
+ --> booleans.rs:17:13
|
17 | let _ = false && a;
| ^^^^^^^^^^ help: it would look like the following `false`
|
= note: `-D logic-bug` implied by `-D warnings`
help: this expression can be optimized out by applying boolean operations to the outer expression
- --> examples/booleans.rs:17:22
+ --> booleans.rs:17:22
|
17 | let _ = false && a;
| ^
error: this boolean expression can be simplified
- --> examples/booleans.rs:18:13
+ --> booleans.rs:18:13
|
18 | let _ = false || a;
| ^^^^^^^^^^ help: try `a`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
- --> examples/booleans.rs:23:13
+ --> booleans.rs:23:13
|
23 | let _ = !(!a && b);
| ^^^^^^^^^^ help: try `!b || a`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression contains a logic bug
- --> examples/booleans.rs:33:13
+ --> booleans.rs:33:13
|
33 | let _ = a == b && a != b;
| ^^^^^^^^^^^^^^^^ help: it would look like the following `false`
|
= note: `-D logic-bug` implied by `-D warnings`
help: this expression can be optimized out by applying boolean operations to the outer expression
- --> examples/booleans.rs:33:13
+ --> booleans.rs:33:13
|
33 | let _ = a == b && a != b;
| ^^^^^^
error: this boolean expression can be simplified
- --> examples/booleans.rs:34:13
+ --> booleans.rs:34:13
|
34 | let _ = a == b && c == 5 && a == b;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| let _ = !(c != 5 || a != b);
error: this boolean expression can be simplified
- --> examples/booleans.rs:35:13
+ --> booleans.rs:35:13
|
35 | let _ = a == b && c == 5 && b == a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| let _ = !(c != 5 || a != b);
error: this boolean expression contains a logic bug
- --> examples/booleans.rs:36:13
+ --> booleans.rs:36:13
|
36 | let _ = a < b && a >= b;
| ^^^^^^^^^^^^^^^ help: it would look like the following `false`
|
= note: `-D logic-bug` implied by `-D warnings`
help: this expression can be optimized out by applying boolean operations to the outer expression
- --> examples/booleans.rs:36:13
+ --> booleans.rs:36:13
|
36 | let _ = a < b && a >= b;
| ^^^^^
error: this boolean expression contains a logic bug
- --> examples/booleans.rs:37:13
+ --> booleans.rs:37:13
|
37 | let _ = a > b && a <= b;
| ^^^^^^^^^^^^^^^ help: it would look like the following `false`
|
= note: `-D logic-bug` implied by `-D warnings`
help: this expression can be optimized out by applying boolean operations to the outer expression
- --> examples/booleans.rs:37:13
+ --> booleans.rs:37:13
|
37 | let _ = a > b && a <= b;
| ^^^^^
error: this boolean expression can be simplified
- --> examples/booleans.rs:39:13
+ --> booleans.rs:39:13
|
39 | let _ = a != b || !(a != b || c == d);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`
- --> examples/box_vec.rs:17:18
+ --> box_vec.rs:17:18
|
17 | pub fn test(foo: Box<Vec<bool>>) {
| ^^^^^^^^^^^^^^
error: casting i32 to f32 causes a loss of precision (i32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
- --> examples/cast.rs:8:5
+ --> cast.rs:8:5
|
8 | 1i32 as f32;
| ^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
error: casting i64 to f32 causes a loss of precision (i64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
- --> examples/cast.rs:9:5
+ --> cast.rs:9:5
|
9 | 1i64 as f32;
| ^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
error: casting i64 to f64 causes a loss of precision (i64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
- --> examples/cast.rs:10:5
+ --> cast.rs:10:5
|
10 | 1i64 as f64;
| ^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
error: casting u32 to f32 causes a loss of precision (u32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
- --> examples/cast.rs:11:5
+ --> cast.rs:11:5
|
11 | 1u32 as f32;
| ^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
error: casting u64 to f32 causes a loss of precision (u64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
- --> examples/cast.rs:12:5
+ --> cast.rs:12:5
|
12 | 1u64 as f32;
| ^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
error: casting u64 to f64 causes a loss of precision (u64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
- --> examples/cast.rs:13:5
+ --> cast.rs:13:5
|
13 | 1u64 as f64;
| ^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
error: casting f32 to i32 may truncate the value
- --> examples/cast.rs:17:5
+ --> cast.rs:17:5
|
17 | 1f32 as i32;
| ^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting f32 to u32 may truncate the value
- --> examples/cast.rs:18:5
+ --> cast.rs:18:5
|
18 | 1f32 as u32;
| ^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting f32 to u32 may lose the sign of the value
- --> examples/cast.rs:18:5
+ --> cast.rs:18:5
|
18 | 1f32 as u32;
| ^^^^^^^^^^^
= note: `-D cast-sign-loss` implied by `-D warnings`
error: casting f64 to f32 may truncate the value
- --> examples/cast.rs:19:5
+ --> cast.rs:19:5
|
19 | 1f64 as f32;
| ^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting i32 to i8 may truncate the value
- --> examples/cast.rs:20:5
+ --> cast.rs:20:5
|
20 | 1i32 as i8;
| ^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting i32 to u8 may lose the sign of the value
- --> examples/cast.rs:21:5
+ --> cast.rs:21:5
|
21 | 1i32 as u8;
| ^^^^^^^^^^
= note: `-D cast-sign-loss` implied by `-D warnings`
error: casting i32 to u8 may truncate the value
- --> examples/cast.rs:21:5
+ --> cast.rs:21:5
|
21 | 1i32 as u8;
| ^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting f64 to isize may truncate the value
- --> examples/cast.rs:22:5
+ --> cast.rs:22:5
|
22 | 1f64 as isize;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting f64 to usize may truncate the value
- --> examples/cast.rs:23:5
+ --> cast.rs:23:5
|
23 | 1f64 as usize;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting f64 to usize may lose the sign of the value
- --> examples/cast.rs:23:5
+ --> cast.rs:23:5
|
23 | 1f64 as usize;
| ^^^^^^^^^^^^^
= note: `-D cast-sign-loss` implied by `-D warnings`
error: casting u8 to i8 may wrap around the value
- --> examples/cast.rs:25:5
+ --> cast.rs:25:5
|
25 | 1u8 as i8;
| ^^^^^^^^^
= note: `-D cast-possible-wrap` implied by `-D warnings`
error: casting u16 to i16 may wrap around the value
- --> examples/cast.rs:26:5
+ --> cast.rs:26:5
|
26 | 1u16 as i16;
| ^^^^^^^^^^^
= note: `-D cast-possible-wrap` implied by `-D warnings`
error: casting u32 to i32 may wrap around the value
- --> examples/cast.rs:27:5
+ --> cast.rs:27:5
|
27 | 1u32 as i32;
| ^^^^^^^^^^^
= note: `-D cast-possible-wrap` implied by `-D warnings`
error: casting u64 to i64 may wrap around the value
- --> examples/cast.rs:28:5
+ --> cast.rs:28:5
|
28 | 1u64 as i64;
| ^^^^^^^^^^^
= note: `-D cast-possible-wrap` implied by `-D warnings`
error: casting usize to isize may wrap around the value
- --> examples/cast.rs:29:5
+ --> cast.rs:29:5
|
29 | 1usize as isize;
| ^^^^^^^^^^^^^^^
= note: `-D cast-possible-wrap` implied by `-D warnings`
error: casting i32 to u32 may lose the sign of the value
- --> examples/cast.rs:31:5
+ --> cast.rs:31:5
|
31 | 1i32 as u32;
| ^^^^^^^^^^^
= note: `-D cast-sign-loss` implied by `-D warnings`
error: casting isize to usize may lose the sign of the value
- --> examples/cast.rs:32:5
+ --> cast.rs:32:5
|
32 | 1isize as usize;
| ^^^^^^^^^^^^^^^
= note: `-D cast-sign-loss` implied by `-D warnings`
error: casting isize to i8 may truncate the value
- --> examples/cast.rs:35:5
+ --> cast.rs:35:5
|
35 | 1isize as i8;
| ^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
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)
- --> examples/cast.rs:36:5
+ --> cast.rs:36:5
|
36 | 1isize as f64;
| ^^^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
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)
- --> examples/cast.rs:37:5
+ --> cast.rs:37:5
|
37 | 1usize as f64;
| ^^^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
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)
- --> examples/cast.rs:38:5
+ --> cast.rs:38:5
|
38 | 1isize as f32;
| ^^^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
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)
- --> examples/cast.rs:39:5
+ --> cast.rs:39:5
|
39 | 1usize as f32;
| ^^^^^^^^^^^^^
= note: `-D cast-precision-loss` implied by `-D warnings`
error: casting isize to i32 may truncate the value on targets with 64-bit wide pointers
- --> examples/cast.rs:40:5
+ --> cast.rs:40:5
|
40 | 1isize as i32;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting isize to u32 may lose the sign of the value
- --> examples/cast.rs:41:5
+ --> cast.rs:41:5
|
41 | 1isize as u32;
| ^^^^^^^^^^^^^
= note: `-D cast-sign-loss` implied by `-D warnings`
error: casting isize to u32 may truncate the value on targets with 64-bit wide pointers
- --> examples/cast.rs:41:5
+ --> cast.rs:41:5
|
41 | 1isize as u32;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting usize to u32 may truncate the value on targets with 64-bit wide pointers
- --> examples/cast.rs:42:5
+ --> cast.rs:42:5
|
42 | 1usize as u32;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting usize to i32 may truncate the value on targets with 64-bit wide pointers
- --> examples/cast.rs:43:5
+ --> cast.rs:43:5
|
43 | 1usize as i32;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting usize to i32 may wrap around the value on targets with 32-bit wide pointers
- --> examples/cast.rs:43:5
+ --> cast.rs:43:5
|
43 | 1usize as i32;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-wrap` implied by `-D warnings`
error: casting i64 to isize may truncate the value on targets with 32-bit wide pointers
- --> examples/cast.rs:45:5
+ --> cast.rs:45:5
|
45 | 1i64 as isize;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting i64 to usize may lose the sign of the value
- --> examples/cast.rs:46:5
+ --> cast.rs:46:5
|
46 | 1i64 as usize;
| ^^^^^^^^^^^^^
= note: `-D cast-sign-loss` implied by `-D warnings`
error: casting i64 to usize may truncate the value on targets with 32-bit wide pointers
- --> examples/cast.rs:46:5
+ --> cast.rs:46:5
|
46 | 1i64 as usize;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting u64 to isize may truncate the value on targets with 32-bit wide pointers
- --> examples/cast.rs:47:5
+ --> cast.rs:47:5
|
47 | 1u64 as isize;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting u64 to isize may wrap around the value on targets with 64-bit wide pointers
- --> examples/cast.rs:47:5
+ --> cast.rs:47:5
|
47 | 1u64 as isize;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-wrap` implied by `-D warnings`
error: casting u64 to usize may truncate the value on targets with 32-bit wide pointers
- --> examples/cast.rs:48:5
+ --> cast.rs:48:5
|
48 | 1u64 as usize;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-truncation` implied by `-D warnings`
error: casting u32 to isize may wrap around the value on targets with 32-bit wide pointers
- --> examples/cast.rs:49:5
+ --> cast.rs:49:5
|
49 | 1u32 as isize;
| ^^^^^^^^^^^^^
= note: `-D cast-possible-wrap` implied by `-D warnings`
error: casting i32 to usize may lose the sign of the value
- --> examples/cast.rs:52:5
+ --> cast.rs:52:5
|
52 | 1i32 as usize;
| ^^^^^^^^^^^^^
= note: `-D cast-sign-loss` implied by `-D warnings`
error: casting to the same type is unnecessary (`i32` -> `i32`)
- --> examples/cast.rs:54:5
+ --> cast.rs:54:5
|
54 | 1i32 as i32;
| ^^^^^^^^^^^
= note: `-D unnecessary-cast` implied by `-D warnings`
error: casting to the same type is unnecessary (`f32` -> `f32`)
- --> examples/cast.rs:55:5
+ --> cast.rs:55:5
|
55 | 1f32 as f32;
| ^^^^^^^^^^^
= note: `-D unnecessary-cast` implied by `-D warnings`
error: casting to the same type is unnecessary (`bool` -> `bool`)
- --> examples/cast.rs:56:5
+ --> cast.rs:56:5
|
56 | false as bool;
| ^^^^^^^^^^^^^
error: casting character literal to u8. `char`s are 4 bytes wide in rust, so casting to u8 truncates them
- --> examples/char_lit_as_u8.rs:7:13
+ --> char_lit_as_u8.rs:7:13
|
7 | let c = 'a' as u8;
| ^^^^^^^^^
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:8:5
+ --> cmp_nan.rs:8:5
|
8 | x == std::f32::NAN;
| ^^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:9:5
+ --> cmp_nan.rs:9:5
|
9 | x != std::f32::NAN;
| ^^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:10:5
+ --> cmp_nan.rs:10:5
|
10 | x < std::f32::NAN;
| ^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:11:5
+ --> cmp_nan.rs:11:5
|
11 | x > std::f32::NAN;
| ^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:12:5
+ --> cmp_nan.rs:12:5
|
12 | x <= std::f32::NAN;
| ^^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:13:5
+ --> cmp_nan.rs:13:5
|
13 | x >= std::f32::NAN;
| ^^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:16:5
+ --> cmp_nan.rs:16:5
|
16 | y == std::f64::NAN;
| ^^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:17:5
+ --> cmp_nan.rs:17:5
|
17 | y != std::f64::NAN;
| ^^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:18:5
+ --> cmp_nan.rs:18:5
|
18 | y < std::f64::NAN;
| ^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:19:5
+ --> cmp_nan.rs:19:5
|
19 | y > std::f64::NAN;
| ^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:20:5
+ --> cmp_nan.rs:20:5
|
20 | y <= std::f64::NAN;
| ^^^^^^^^^^^^^^^^^^
= note: `-D cmp-nan` implied by `-D warnings`
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
- --> examples/cmp_nan.rs:21:5
+ --> cmp_nan.rs:21:5
|
21 | y >= std::f64::NAN;
| ^^^^^^^^^^^^^^^^^^
error: Comparing with null is better expressed by the .is_null() method
- --> examples/cmp_null.rs:11:8
+ --> cmp_null.rs:11:8
|
11 | if p == ptr::null() {
| ^^^^^^^^^^^^^^^^
= note: `-D cmp-null` implied by `-D warnings`
error: Comparing with null is better expressed by the .is_null() method
- --> examples/cmp_null.rs:16:8
+ --> cmp_null.rs:16:8
|
16 | if m == ptr::null_mut() {
| ^^^^^^^^^^^^^^^^^^^^
error: this creates an owned instance just for comparison
- --> examples/cmp_owned.rs:8:14
+ --> cmp_owned.rs:8:14
|
8 | x != "foo".to_string();
| ^^^^^^^^^^^^^^^^^ help: try `"foo"`
= note: `-D cmp-owned` implied by `-D warnings`
error: this creates an owned instance just for comparison
- --> examples/cmp_owned.rs:10:9
+ --> cmp_owned.rs:10:9
|
10 | "foo".to_string() != x;
| ^^^^^^^^^^^^^^^^^ help: try `"foo"`
= note: `-D cmp-owned` implied by `-D warnings`
error: this creates an owned instance just for comparison
- --> examples/cmp_owned.rs:17:10
+ --> cmp_owned.rs:17:10
|
17 | x != "foo".to_owned();
| ^^^^^^^^^^^^^^^^ help: try `"foo"`
= note: `-D cmp-owned` implied by `-D warnings`
error: this creates an owned instance just for comparison
- --> examples/cmp_owned.rs:19:10
+ --> cmp_owned.rs:19:10
|
19 | x != String::from("foo");
| ^^^^^^^^^^^^^^^^^^^ help: try `"foo"`
= note: `-D cmp-owned` implied by `-D warnings`
error: this creates an owned instance just for comparison
- --> examples/cmp_owned.rs:23:5
+ --> cmp_owned.rs:23:5
|
23 | Foo.to_owned() == Foo;
| ^^^^^^^^^^^^^^ help: try `Foo`
= note: `-D cmp-owned` implied by `-D warnings`
error: this creates an owned instance just for comparison
- --> examples/cmp_owned.rs:30:9
+ --> cmp_owned.rs:30:9
|
30 | self.to_owned() == *other
| ^^^^^^^^^^^^^^^ try calling implementing the comparison without allocating
error: this if statement can be collapsed
- --> examples/collapsible_if.rs:8:5
+ --> collapsible_if.rs:8:5
|
8 | / if x == "hello" {
9 | | if y == "world" {
| }
error: this if statement can be collapsed
- --> examples/collapsible_if.rs:14:5
+ --> collapsible_if.rs:14:5
|
14 | / if x == "hello" || x == "world" {
15 | | if y == "world" || y == "hello" {
| }
error: this if statement can be collapsed
- --> examples/collapsible_if.rs:20:5
+ --> collapsible_if.rs:20:5
|
20 | / if x == "hello" && x == "world" {
21 | | if y == "world" || y == "hello" {
| }
error: this if statement can be collapsed
- --> examples/collapsible_if.rs:26:5
+ --> collapsible_if.rs:26:5
|
26 | / if x == "hello" || x == "world" {
27 | | if y == "world" && y == "hello" {
| }
error: this if statement can be collapsed
- --> examples/collapsible_if.rs:32:5
+ --> collapsible_if.rs:32:5
|
32 | / if x == "hello" && x == "world" {
33 | | if y == "world" && y == "hello" {
| }
error: this if statement can be collapsed
- --> examples/collapsible_if.rs:38:5
+ --> collapsible_if.rs:38:5
|
38 | / if 42 == 1337 {
39 | | if 'a' != 'A' {
| }
error: this `else { if .. }` block can be collapsed
- --> examples/collapsible_if.rs:47:12
+ --> collapsible_if.rs:47:12
|
47 | } else {
| ____________^
| }
error: this `else { if .. }` block can be collapsed
- --> examples/collapsible_if.rs:55:12
+ --> collapsible_if.rs:55:12
|
55 | } else {
| ____________^
| }
error: this `else { if .. }` block can be collapsed
- --> examples/collapsible_if.rs:63:12
+ --> collapsible_if.rs:63:12
|
63 | } else {
| ____________^
| }
error: this `else { if .. }` block can be collapsed
- --> examples/collapsible_if.rs:74:12
+ --> collapsible_if.rs:74:12
|
74 | } else {
| ____________^
| }
error: this `else { if .. }` block can be collapsed
- --> examples/collapsible_if.rs:85:12
+ --> collapsible_if.rs:85:12
|
85 | } else {
| ____________^
| }
error: this `else { if .. }` block can be collapsed
- --> examples/collapsible_if.rs:96:12
+ --> collapsible_if.rs:96:12
|
96 | } else {
| ____________^
| }
error: this `else { if .. }` block can be collapsed
- --> examples/collapsible_if.rs:107:12
+ --> collapsible_if.rs:107:12
|
107 | } else {
| ____________^
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:9:12
+ --> complex_types.rs:9:12
|
9 | const CST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:10:12
+ --> complex_types.rs:10:12
|
10 | static ST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:13:8
+ --> complex_types.rs:13:8
|
13 | f: Vec<Vec<Box<(u32, u32, u32, u32)>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:16:11
+ --> complex_types.rs:16:11
|
16 | struct TS(Vec<Vec<Box<(u32, u32, u32, u32)>>>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:19:11
+ --> complex_types.rs:19:11
|
19 | Tuple(Vec<Vec<Box<(u32, u32, u32, u32)>>>),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:20:17
+ --> complex_types.rs:20:17
|
20 | Struct { f: Vec<Vec<Box<(u32, u32, u32, u32)>>> },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:24:14
+ --> complex_types.rs:24:14
|
24 | const A: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:25:30
+ --> complex_types.rs:25:30
|
25 | fn impl_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:29:14
+ --> complex_types.rs:29:14
|
29 | const A: Vec<Vec<Box<(u32, u32, u32, u32)>>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:30:14
+ --> complex_types.rs:30:14
|
30 | type B = Vec<Vec<Box<(u32, u32, u32, u32)>>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:31:25
+ --> complex_types.rs:31:25
|
31 | fn method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:32:29
+ --> complex_types.rs:32:29
|
32 | fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:35:15
+ --> complex_types.rs:35:15
|
35 | fn test1() -> Vec<Vec<Box<(u32, u32, u32, u32)>>> { vec![] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:37:14
+ --> complex_types.rs:37:14
|
37 | fn test2(_x: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D type-complexity` implied by `-D warnings`
error: very complex type used. Consider factoring parts into `type` definitions
- --> examples/complex_types.rs:40:13
+ --> complex_types.rs:40:13
|
40 | let _y: Vec<Vec<Box<(u32, u32, u32, u32)>>> = vec![];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: This else block is redundant.
- --> examples/copies.rs:121:20
+ --> copies.rs:121:20
|
121 | } else {
| ____________________^
error: This else block is redundant.
- --> examples/copies.rs:131:20
+ --> copies.rs:131:20
|
131 | } else {
| ____________________^
error: the function has a cyclomatic complexity of 28
- --> examples/cyclomatic_complexity.rs:7:1
+ --> cyclomatic_complexity.rs:7:1
|
7 | / fn main() {
8 | | if true {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 7
- --> examples/cyclomatic_complexity.rs:92:1
+ --> cyclomatic_complexity.rs:92:1
|
92 | / fn kaboom() {
93 | | let n = 0;
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
- --> examples/cyclomatic_complexity.rs:138:1
+ --> cyclomatic_complexity.rs:138:1
|
138 | / fn lots_of_short_circuits() -> bool {
139 | | true && false && true && false && true && false && true
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
- --> examples/cyclomatic_complexity.rs:143:1
+ --> cyclomatic_complexity.rs:143:1
|
143 | / fn lots_of_short_circuits2() -> bool {
144 | | true || false || true || false || true || false || true
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
- --> examples/cyclomatic_complexity.rs:148:1
+ --> cyclomatic_complexity.rs:148:1
|
148 | / fn baa() {
149 | | let x = || match 99 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
- --> examples/cyclomatic_complexity.rs:149:13
+ --> cyclomatic_complexity.rs:149:13
|
149 | let x = || match 99 {
| _____________^
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
- --> examples/cyclomatic_complexity.rs:166:1
+ --> cyclomatic_complexity.rs:166:1
|
166 | / fn bar() {
167 | | match 99 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
- --> examples/cyclomatic_complexity.rs:185:1
+ --> cyclomatic_complexity.rs:185:1
|
185 | / fn barr() {
186 | | match 99 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 3
- --> examples/cyclomatic_complexity.rs:195:1
+ --> cyclomatic_complexity.rs:195:1
|
195 | / fn barr2() {
196 | | match 99 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
- --> examples/cyclomatic_complexity.rs:211:1
+ --> cyclomatic_complexity.rs:211:1
|
211 | / fn barrr() {
212 | | match 99 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 3
- --> examples/cyclomatic_complexity.rs:221:1
+ --> cyclomatic_complexity.rs:221:1
|
221 | / fn barrr2() {
222 | | match 99 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
- --> examples/cyclomatic_complexity.rs:237:1
+ --> cyclomatic_complexity.rs:237:1
|
237 | / fn barrrr() {
238 | | match 99 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 3
- --> examples/cyclomatic_complexity.rs:247:1
+ --> cyclomatic_complexity.rs:247:1
|
247 | / fn barrrr2() {
248 | | match 99 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
- --> examples/cyclomatic_complexity.rs:263:1
+ --> cyclomatic_complexity.rs:263:1
|
263 | / fn cake() {
264 | | if 4 == 5 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 4
- --> examples/cyclomatic_complexity.rs:274:1
+ --> cyclomatic_complexity.rs:274:1
|
274 | / pub fn read_file(input_path: &str) -> String {
275 | | use std::fs::File;
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
- --> examples/cyclomatic_complexity.rs:305:1
+ --> cyclomatic_complexity.rs:305:1
|
305 | / fn void(void: Void) {
306 | | if true {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
- --> examples/cyclomatic_complexity.rs:319:1
+ --> cyclomatic_complexity.rs:319:1
|
319 | / fn try() -> Result<i32, &'static str> {
320 | | match 5 {
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
- --> examples/cyclomatic_complexity.rs:327:1
+ --> cyclomatic_complexity.rs:327:1
|
327 | / fn try_again() -> Result<i32, &'static str> {
328 | | let _ = try!(Ok(42));
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
- --> examples/cyclomatic_complexity.rs:343:1
+ --> cyclomatic_complexity.rs:343:1
|
343 | / fn early() -> Result<i32, &'static str> {
344 | | return Ok(5);
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 8
- --> examples/cyclomatic_complexity.rs:356:1
+ --> cyclomatic_complexity.rs:356:1
|
356 | / fn early_ret() -> i32 {
357 | | let a = if true { 42 } else { return 0; };
error: the function has a cyclomatic complexity of 3
- --> examples/cyclomatic_complexity_attr_used.rs:11:1
+ --> cyclomatic_complexity_attr_used.rs:11:1
|
11 | / fn kaboom() {
12 | | if 42 == 43 {
error: you are deriving `Hash` but have implemented `PartialEq` explicitly
- --> examples/derive.rs:17:10
+ --> derive.rs:17:10
|
17 | #[derive(Hash)]
| ^^^^
|
= note: `-D derive-hash-xor-eq` implied by `-D warnings`
note: `PartialEq` implemented here
- --> examples/derive.rs:20:1
+ --> derive.rs:20:1
|
20 | / impl PartialEq for Bar {
21 | | fn eq(&self, _: &Bar) -> bool { true }
| |_^
error: you are deriving `Hash` but have implemented `PartialEq` explicitly
- --> examples/derive.rs:24:10
+ --> derive.rs:24:10
|
24 | #[derive(Hash)]
| ^^^^
|
= note: `-D derive-hash-xor-eq` implied by `-D warnings`
note: `PartialEq` implemented here
- --> examples/derive.rs:27:1
+ --> derive.rs:27:1
|
27 | / impl PartialEq<Baz> for Baz {
28 | | fn eq(&self, _: &Baz) -> bool { true }
| |_^
error: you are implementing `Hash` explicitly but have derived `PartialEq`
- --> examples/derive.rs:34:1
+ --> derive.rs:34:1
|
34 | / impl Hash for Bah {
35 | | fn hash<H: Hasher>(&self, _: &mut H) {}
|
= note: `-D derive-hash-xor-eq` implied by `-D warnings`
note: `PartialEq` implemented here
- --> examples/derive.rs:31:10
+ --> derive.rs:31:10
|
31 | #[derive(PartialEq)]
| ^^^^^^^^^
error: you are implementing `Clone` explicitly on a `Copy` type
- --> examples/derive.rs:41:1
+ --> derive.rs:41:1
|
41 | / impl Clone for Qux {
42 | | fn clone(&self) -> Self { Qux }
|
= note: `-D expl-impl-clone-on-copy` implied by `-D warnings`
note: consider deriving `Clone` or removing `Copy`
- --> examples/derive.rs:41:1
+ --> derive.rs:41:1
|
41 | / impl Clone for Qux {
42 | | fn clone(&self) -> Self { Qux }
| |_^
error: you are implementing `Clone` explicitly on a `Copy` type
- --> examples/derive.rs:65:1
+ --> derive.rs:65:1
|
65 | / impl<'a> Clone for Lt<'a> {
66 | | fn clone(&self) -> Self { unimplemented!() }
|
= note: `-D expl-impl-clone-on-copy` implied by `-D warnings`
note: consider deriving `Clone` or removing `Copy`
- --> examples/derive.rs:65:1
+ --> derive.rs:65:1
|
65 | / impl<'a> Clone for Lt<'a> {
66 | | fn clone(&self) -> Self { unimplemented!() }
error: sub-expression diverges
- --> examples/diverging_sub_expression.rs:18:10
+ --> diverging_sub_expression.rs:18:10
|
18 | b || diverge();
| ^^^^^^^^^
= note: `-D diverging-sub-expression` implied by `-D warnings`
error: sub-expression diverges
- --> examples/diverging_sub_expression.rs:19:10
+ --> diverging_sub_expression.rs:19:10
|
19 | b || A.foo();
| ^^^^^^^
= note: `-D diverging-sub-expression` implied by `-D warnings`
error: sub-expression diverges
- --> examples/diverging_sub_expression.rs:28:26
+ --> diverging_sub_expression.rs:28:26
|
28 | 6 => true || return,
| ^^^^^^
= note: `-D diverging-sub-expression` implied by `-D warnings`
error: sub-expression diverges
- --> examples/diverging_sub_expression.rs:29:26
+ --> diverging_sub_expression.rs:29:26
|
29 | 7 => true || continue,
| ^^^^^^^^
= note: `-D diverging-sub-expression` implied by `-D warnings`
error: sub-expression diverges
- --> examples/diverging_sub_expression.rs:32:26
+ --> diverging_sub_expression.rs:32:26
|
32 | 3 => true || diverge(),
| ^^^^^^^^^
= note: `-D diverging-sub-expression` implied by `-D warnings`
error: sub-expression diverges
- --> examples/diverging_sub_expression.rs:37:26
+ --> diverging_sub_expression.rs:37:26
|
37 | _ => true || break,
| ^^^^^
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
- --> examples/dlist.rs:13:16
+ --> dlist.rs:13:16
|
13 | type Baz = LinkedList<u8>;
| ^^^^^^^^^^^^^^
= help: a VecDeque might work
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
- --> examples/dlist.rs:14:12
+ --> dlist.rs:14:12
|
14 | fn foo(LinkedList<u8>);
| ^^^^^^^^^^^^^^
= help: a VecDeque might work
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
- --> examples/dlist.rs:15:24
+ --> dlist.rs:15:24
|
15 | const BAR : Option<LinkedList<u8>>;
| ^^^^^^^^^^^^^^
= help: a VecDeque might work
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
- --> examples/dlist.rs:26:15
+ --> dlist.rs:26:15
|
26 | fn foo(_: LinkedList<u8>) {}
| ^^^^^^^^^^^^^^
= help: a VecDeque might work
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
- --> examples/dlist.rs:29:39
+ --> dlist.rs:29:39
|
29 | pub fn test(my_favourite_linked_list: LinkedList<u8>) {
| ^^^^^^^^^^^^^^
= help: a VecDeque might work
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
- --> examples/dlist.rs:33:29
+ --> dlist.rs:33:29
|
33 | pub fn test_ret() -> Option<LinkedList<u8>> {
| ^^^^^^^^^^^^^^
error: you should put `DOC_MARKDOWN` between ticks in the documentation
- --> examples/doc.rs:1:29
+ --> doc.rs:1:29
|
1 | //! This file tests for the DOC_MARKDOWN lint
| ^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `foo_bar` between ticks in the documentation
- --> examples/doc.rs:8:9
+ --> doc.rs:8:9
|
8 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
| ^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `foo::bar` between ticks in the documentation
- --> examples/doc.rs:8:51
+ --> doc.rs:8:51
|
8 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
| ^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `Foo::some_fun` between ticks in the documentation
- --> examples/doc.rs:9:84
+ --> doc.rs:9:84
|
9 | /// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not Foo::some_fun
| ^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `is::a::global:path` between ticks in the documentation
- --> examples/doc.rs:11:13
+ --> doc.rs:11:13
|
11 | /// Here be ::is::a::global:path.
| ^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `NotInCodeBlock` between ticks in the documentation
- --> examples/doc.rs:12:21
+ --> doc.rs:12:21
|
12 | /// That's not code ~NotInCodeBlock~.
| ^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:13:5
+ --> doc.rs:13:5
|
13 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:27:5
+ --> doc.rs:27:5
|
27 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:34:5
+ --> doc.rs:34:5
|
34 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:48:5
+ --> doc.rs:48:5
|
48 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `ß_foo` between ticks in the documentation
- --> examples/doc.rs:57:5
+ --> doc.rs:57:5
|
57 | /// ß_foo
| ^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `ℝ_foo` between ticks in the documentation
- --> examples/doc.rs:58:5
+ --> doc.rs:58:5
|
58 | /// ℝ_foo
| ^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `foo_ß` between ticks in the documentation
- --> examples/doc.rs:61:5
+ --> doc.rs:61:5
|
61 | /// foo_ß
| ^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `foo_ℝ` between ticks in the documentation
- --> examples/doc.rs:62:5
+ --> doc.rs:62:5
|
62 | /// foo_ℝ
| ^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:77:5
+ --> doc.rs:77:5
|
77 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `link_with_underscores` between ticks in the documentation
- --> examples/doc.rs:81:22
+ --> doc.rs:81:22
|
81 | /// This test has [a link_with_underscores][chunked-example] inside it. See #823.
| ^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `inline_link2` between ticks in the documentation
- --> examples/doc.rs:84:21
+ --> doc.rs:84:21
|
84 | /// It can also be [inline_link2].
| ^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:94:5
+ --> doc.rs:94:5
|
94 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `CamelCaseThing` between ticks in the documentation
- --> examples/doc.rs:107:22
+ --> doc.rs:107:22
|
107 | /// Not a title #897 CamelCaseThing
| ^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:108:5
+ --> doc.rs:108:5
|
108 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:115:5
+ --> doc.rs:115:5
|
115 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:128:5
+ --> doc.rs:128:5
|
128 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `FooBar` between ticks in the documentation
- --> examples/doc.rs:139:42
+ --> doc.rs:139:42
|
139 | /** E.g. serialization of an empty list: FooBar
| ^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `BarQuz` between ticks in the documentation
- --> examples/doc.rs:144:5
+ --> doc.rs:144:5
|
144 | And BarQuz too.
| ^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:145:1
+ --> doc.rs:145:1
|
145 | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `FooBar` between ticks in the documentation
- --> examples/doc.rs:150:42
+ --> doc.rs:150:42
|
150 | /** E.g. serialization of an empty list: FooBar
| ^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `BarQuz` between ticks in the documentation
- --> examples/doc.rs:155:5
+ --> doc.rs:155:5
|
155 | And BarQuz too.
| ^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:156:1
+ --> doc.rs:156:1
|
156 | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D doc-markdown` implied by `-D warnings`
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
- --> examples/doc.rs:167:5
+ --> doc.rs:167:5
|
167 | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `--x` could be misinterpreted as pre-decrement by C programmers, is usually a no-op
- --> examples/double_neg.rs:9:5
+ --> double_neg.rs:9:5
|
9 | --x;
| ^^^
error: Consider removing unnecessary double parentheses
- --> examples/double_parens.rs:16:5
+ --> double_parens.rs:16:5
|
16 | ((0))
| ^^^^^
= note: `-D double-parens` implied by `-D warnings`
error: Consider removing unnecessary double parentheses
- --> examples/double_parens.rs:20:14
+ --> double_parens.rs:20:14
|
20 | dummy_fn((0));
| ^^^
= note: `-D double-parens` implied by `-D warnings`
error: Consider removing unnecessary double parentheses
- --> examples/double_parens.rs:24:20
+ --> double_parens.rs:24:20
|
24 | x.dummy_method((0));
| ^^^
= note: `-D double-parens` implied by `-D warnings`
error: Consider removing unnecessary double parentheses
- --> examples/double_parens.rs:28:5
+ --> double_parens.rs:28:5
|
28 | ((1, 2))
| ^^^^^^^^
= note: `-D double-parens` implied by `-D warnings`
error: Consider removing unnecessary double parentheses
- --> examples/double_parens.rs:32:5
+ --> double_parens.rs:32:5
|
32 | (())
| ^^^^
error: calls to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
- --> examples/drop_forget_copy.rs:33:5
+ --> drop_forget_copy.rs:33:5
|
33 | drop(s1);
| ^^^^^^^^
|
= note: `-D drop-copy` implied by `-D warnings`
note: argument has type SomeStruct
- --> examples/drop_forget_copy.rs:33:10
+ --> drop_forget_copy.rs:33:10
|
33 | drop(s1);
| ^^
error: calls to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
- --> examples/drop_forget_copy.rs:34:5
+ --> drop_forget_copy.rs:34:5
|
34 | drop(s2);
| ^^^^^^^^
|
= note: `-D drop-copy` implied by `-D warnings`
note: argument has type SomeStruct
- --> examples/drop_forget_copy.rs:34:10
+ --> drop_forget_copy.rs:34:10
|
34 | drop(s2);
| ^^
error: calls to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
- --> examples/drop_forget_copy.rs:36:5
+ --> drop_forget_copy.rs:36:5
|
36 | drop(s4);
| ^^^^^^^^
|
= note: `-D drop-copy` implied by `-D warnings`
note: argument has type SomeStruct
- --> examples/drop_forget_copy.rs:36:10
+ --> drop_forget_copy.rs:36:10
|
36 | drop(s4);
| ^^
error: calls to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
- --> examples/drop_forget_copy.rs:39:5
+ --> drop_forget_copy.rs:39:5
|
39 | forget(s1);
| ^^^^^^^^^^
|
= note: `-D forget-copy` implied by `-D warnings`
note: argument has type SomeStruct
- --> examples/drop_forget_copy.rs:39:12
+ --> drop_forget_copy.rs:39:12
|
39 | forget(s1);
| ^^
error: calls to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
- --> examples/drop_forget_copy.rs:40:5
+ --> drop_forget_copy.rs:40:5
|
40 | forget(s2);
| ^^^^^^^^^^
|
= note: `-D forget-copy` implied by `-D warnings`
note: argument has type SomeStruct
- --> examples/drop_forget_copy.rs:40:12
+ --> drop_forget_copy.rs:40:12
|
40 | forget(s2);
| ^^
error: calls to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
- --> examples/drop_forget_copy.rs:42:5
+ --> drop_forget_copy.rs:42:5
|
42 | forget(s4);
| ^^^^^^^^^^
|
= note: `-D forget-copy` implied by `-D warnings`
note: argument has type SomeStruct
- --> examples/drop_forget_copy.rs:42:12
+ --> drop_forget_copy.rs:42:12
|
42 | forget(s4);
| ^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
- --> examples/drop_forget_ref.rs:12:5
+ --> drop_forget_ref.rs:12:5
|
12 | drop(&SomeStruct);
| ^^^^^^^^^^^^^^^^^
|
= note: `-D drop-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:12:10
+ --> drop_forget_ref.rs:12:10
|
12 | drop(&SomeStruct);
| ^^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
- --> examples/drop_forget_ref.rs:13:5
+ --> drop_forget_ref.rs:13:5
|
13 | forget(&SomeStruct);
| ^^^^^^^^^^^^^^^^^^^
|
= note: `-D forget-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:13:12
+ --> drop_forget_ref.rs:13:12
|
13 | forget(&SomeStruct);
| ^^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
- --> examples/drop_forget_ref.rs:16:5
+ --> drop_forget_ref.rs:16:5
|
16 | drop(&owned1);
| ^^^^^^^^^^^^^
|
= note: `-D drop-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:16:10
+ --> drop_forget_ref.rs:16:10
|
16 | drop(&owned1);
| ^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
- --> examples/drop_forget_ref.rs:17:5
+ --> drop_forget_ref.rs:17:5
|
17 | drop(&&owned1);
| ^^^^^^^^^^^^^^
|
= note: `-D drop-ref` implied by `-D warnings`
note: argument has type &&SomeStruct
- --> examples/drop_forget_ref.rs:17:10
+ --> drop_forget_ref.rs:17:10
|
17 | drop(&&owned1);
| ^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
- --> examples/drop_forget_ref.rs:18:5
+ --> drop_forget_ref.rs:18:5
|
18 | drop(&mut owned1);
| ^^^^^^^^^^^^^^^^^
|
= note: `-D drop-ref` implied by `-D warnings`
note: argument has type &mut SomeStruct
- --> examples/drop_forget_ref.rs:18:10
+ --> drop_forget_ref.rs:18:10
|
18 | drop(&mut owned1);
| ^^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
- --> examples/drop_forget_ref.rs:21:5
+ --> drop_forget_ref.rs:21:5
|
21 | forget(&owned2);
| ^^^^^^^^^^^^^^^
|
= note: `-D forget-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:21:12
+ --> drop_forget_ref.rs:21:12
|
21 | forget(&owned2);
| ^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
- --> examples/drop_forget_ref.rs:22:5
+ --> drop_forget_ref.rs:22:5
|
22 | forget(&&owned2);
| ^^^^^^^^^^^^^^^^
|
= note: `-D forget-ref` implied by `-D warnings`
note: argument has type &&SomeStruct
- --> examples/drop_forget_ref.rs:22:12
+ --> drop_forget_ref.rs:22:12
|
22 | forget(&&owned2);
| ^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
- --> examples/drop_forget_ref.rs:23:5
+ --> drop_forget_ref.rs:23:5
|
23 | forget(&mut owned2);
| ^^^^^^^^^^^^^^^^^^^
|
= note: `-D forget-ref` implied by `-D warnings`
note: argument has type &mut SomeStruct
- --> examples/drop_forget_ref.rs:23:12
+ --> drop_forget_ref.rs:23:12
|
23 | forget(&mut owned2);
| ^^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
- --> examples/drop_forget_ref.rs:27:5
+ --> drop_forget_ref.rs:27:5
|
27 | drop(reference1);
| ^^^^^^^^^^^^^^^^
|
= note: `-D drop-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:27:10
+ --> drop_forget_ref.rs:27:10
|
27 | drop(reference1);
| ^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
- --> examples/drop_forget_ref.rs:28:5
+ --> drop_forget_ref.rs:28:5
|
28 | forget(&*reference1);
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `-D forget-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:28:12
+ --> drop_forget_ref.rs:28:12
|
28 | forget(&*reference1);
| ^^^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
- --> examples/drop_forget_ref.rs:31:5
+ --> drop_forget_ref.rs:31:5
|
31 | drop(reference2);
| ^^^^^^^^^^^^^^^^
|
= note: `-D drop-ref` implied by `-D warnings`
note: argument has type &mut SomeStruct
- --> examples/drop_forget_ref.rs:31:10
+ --> drop_forget_ref.rs:31:10
|
31 | drop(reference2);
| ^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
- --> examples/drop_forget_ref.rs:33:5
+ --> drop_forget_ref.rs:33:5
|
33 | forget(reference3);
| ^^^^^^^^^^^^^^^^^^
|
= note: `-D forget-ref` implied by `-D warnings`
note: argument has type &mut SomeStruct
- --> examples/drop_forget_ref.rs:33:12
+ --> drop_forget_ref.rs:33:12
|
33 | forget(reference3);
| ^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
- --> examples/drop_forget_ref.rs:36:5
+ --> drop_forget_ref.rs:36:5
|
36 | drop(reference4);
| ^^^^^^^^^^^^^^^^
|
= note: `-D drop-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:36:10
+ --> drop_forget_ref.rs:36:10
|
36 | drop(reference4);
| ^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
- --> examples/drop_forget_ref.rs:37:5
+ --> drop_forget_ref.rs:37:5
|
37 | forget(reference4);
| ^^^^^^^^^^^^^^^^^^
|
= note: `-D forget-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:37:12
+ --> drop_forget_ref.rs:37:12
|
37 | forget(reference4);
| ^^^^^^^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
- --> examples/drop_forget_ref.rs:42:5
+ --> drop_forget_ref.rs:42:5
|
42 | drop(&val);
| ^^^^^^^^^^
|
= note: `-D drop-ref` implied by `-D warnings`
note: argument has type &T
- --> examples/drop_forget_ref.rs:42:10
+ --> drop_forget_ref.rs:42:10
|
42 | drop(&val);
| ^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
- --> examples/drop_forget_ref.rs:48:5
+ --> drop_forget_ref.rs:48:5
|
48 | forget(&val);
| ^^^^^^^^^^^^
|
= note: `-D forget-ref` implied by `-D warnings`
note: argument has type &T
- --> examples/drop_forget_ref.rs:48:12
+ --> drop_forget_ref.rs:48:12
|
48 | forget(&val);
| ^^^^
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
- --> examples/drop_forget_ref.rs:56:5
+ --> drop_forget_ref.rs:56:5
|
56 | std::mem::drop(&SomeStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D drop-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:56:20
+ --> drop_forget_ref.rs:56:20
|
56 | std::mem::drop(&SomeStruct);
| ^^^^^^^^^^^
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
- --> examples/drop_forget_ref.rs:59:5
+ --> drop_forget_ref.rs:59:5
|
59 | std::mem::forget(&SomeStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D forget-ref` implied by `-D warnings`
note: argument has type &SomeStruct
- --> examples/drop_forget_ref.rs:59:22
+ --> drop_forget_ref.rs:59:22
|
59 | std::mem::forget(&SomeStruct);
| ^^^^^^^^^^^
error: `darth` already exists, having another argument having almost the same name makes code comprehension and documentation more difficult
- --> examples/duplicate_underscore_argument.rs:7:23
+ --> duplicate_underscore_argument.rs:7:23
|
7 | fn join_the_dark_side(darth: i32, _darth: i32) {}
| ^^^^^
error: enum with no variants
- --> examples/empty_enum.rs:7:1
+ --> empty_enum.rs:7:1
|
7 | enum Empty {}
| ^^^^^^^^^^^^^
|
= note: `-D empty-enum` implied by `-D warnings`
help: consider using the uninhabited type `!` or a wrapper around it
- --> examples/empty_enum.rs:7:1
+ --> empty_enum.rs:7:1
|
7 | enum Empty {}
| ^^^^^^^^^^^^^
error: usage of `contains_key` followed by `insert` on a `HashMap`
- --> examples/entry.rs:13:5
+ --> entry.rs:13:5
|
13 | if !m.contains_key(&k) { m.insert(k, v); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k).or_insert(v)`
= note: `-D map-entry` implied by `-D warnings`
error: usage of `contains_key` followed by `insert` on a `HashMap`
- --> examples/entry.rs:17:5
+ --> entry.rs:17:5
|
17 | if !m.contains_key(&k) { foo(); m.insert(k, v); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
= note: `-D map-entry` implied by `-D warnings`
error: usage of `contains_key` followed by `insert` on a `HashMap`
- --> examples/entry.rs:21:5
+ --> entry.rs:21:5
|
21 | if !m.contains_key(&k) { m.insert(k, v) } else { None };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
= note: `-D map-entry` implied by `-D warnings`
error: usage of `contains_key` followed by `insert` on a `HashMap`
- --> examples/entry.rs:25:5
+ --> entry.rs:25:5
|
25 | if m.contains_key(&k) { None } else { m.insert(k, v) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
= note: `-D map-entry` implied by `-D warnings`
error: usage of `contains_key` followed by `insert` on a `HashMap`
- --> examples/entry.rs:29:5
+ --> entry.rs:29:5
|
29 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
= note: `-D map-entry` implied by `-D warnings`
error: usage of `contains_key` followed by `insert` on a `HashMap`
- --> examples/entry.rs:33:5
+ --> entry.rs:33:5
|
33 | if m.contains_key(&k) { None } else { foo(); m.insert(k, v) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
= note: `-D map-entry` implied by `-D warnings`
error: usage of `contains_key` followed by `insert` on a `BTreeMap`
- --> examples/entry.rs:37:5
+ --> entry.rs:37:5
|
37 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
error: don't use glob imports for enum variants
- --> examples/enum_glob_use.rs:6:1
+ --> enum_glob_use.rs:6:1
|
6 | use std::cmp::Ordering::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D enum-glob-use` implied by `-D warnings`
error: don't use glob imports for enum variants
- --> examples/enum_glob_use.rs:12:1
+ --> enum_glob_use.rs:12:1
|
12 | use self::Enum::*;
| ^^^^^^^^^^^^^^^^^^
error: Variant name ends with the enum's name
- --> examples/enum_variants.rs:14:5
+ --> enum_variants.rs:14:5
|
14 | cFoo,
| ^^^^
= note: `-D enum-variant-names` implied by `-D warnings`
error: Variant name starts with the enum's name
- --> examples/enum_variants.rs:25:5
+ --> enum_variants.rs:25:5
|
25 | FoodGood,
| ^^^^^^^^
= note: `-D enum-variant-names` implied by `-D warnings`
error: Variant name starts with the enum's name
- --> examples/enum_variants.rs:26:5
+ --> enum_variants.rs:26:5
|
26 | FoodMiddle,
| ^^^^^^^^^^
= note: `-D enum-variant-names` implied by `-D warnings`
error: Variant name starts with the enum's name
- --> examples/enum_variants.rs:27:5
+ --> enum_variants.rs:27:5
|
27 | FoodBad,
| ^^^^^^^
= note: `-D enum-variant-names` implied by `-D warnings`
error: All variants have the same prefix: `Food`
- --> examples/enum_variants.rs:24:1
+ --> enum_variants.rs:24:1
|
24 | / enum Food {
25 | | FoodGood,
= help: remove the prefixes and use full paths to the variants instead of glob imports
error: All variants have the same prefix: `CallType`
- --> examples/enum_variants.rs:34:1
+ --> enum_variants.rs:34:1
|
34 | / enum BadCallType {
35 | | CallTypeCall,
= help: remove the prefixes and use full paths to the variants instead of glob imports
error: All variants have the same prefix: `Constant`
- --> examples/enum_variants.rs:45:1
+ --> enum_variants.rs:45:1
|
45 | / enum Consts {
46 | | ConstantInt,
= help: remove the prefixes and use full paths to the variants instead of glob imports
error: All variants have the same prefix: `With`
- --> examples/enum_variants.rs:78:1
+ --> enum_variants.rs:78:1
|
78 | / enum Seallll {
79 | | WithOutCake,
= help: remove the prefixes and use full paths to the variants instead of glob imports
error: All variants have the same prefix: `Prefix`
- --> examples/enum_variants.rs:84:1
+ --> enum_variants.rs:84:1
|
84 | / enum NonCaps {
85 | | Prefix的,
= help: remove the prefixes and use full paths to the variants instead of glob imports
error: All variants have the same prefix: `With`
- --> examples/enum_variants.rs:90:1
+ --> enum_variants.rs:90:1
|
90 | / pub enum PubSeall {
91 | | WithOutCake,
error: Clike enum variant discriminant is not portable to 32-bit targets
- --> examples/enums_clike.rs:10:5
+ --> enums_clike.rs:10:5
|
10 | X = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^
= note: `-D enum-clike-unportable-variant` implied by `-D warnings`
error: Clike enum variant discriminant is not portable to 32-bit targets
- --> examples/enums_clike.rs:17:5
+ --> enums_clike.rs:17:5
|
17 | X = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^
= note: `-D enum-clike-unportable-variant` implied by `-D warnings`
error: Clike enum variant discriminant is not portable to 32-bit targets
- --> examples/enums_clike.rs:20:5
+ --> enums_clike.rs:20:5
|
20 | A = 0xFFFF_FFFF,
| ^^^^^^^^^^^^^^^
= note: `-D enum-clike-unportable-variant` implied by `-D warnings`
error: Clike enum variant discriminant is not portable to 32-bit targets
- --> examples/enums_clike.rs:27:5
+ --> enums_clike.rs:27:5
|
27 | Z = 0xFFFF_FFFF,
| ^^^^^^^^^^^^^^^
= note: `-D enum-clike-unportable-variant` implied by `-D warnings`
error: Clike enum variant discriminant is not portable to 32-bit targets
- --> examples/enums_clike.rs:28:5
+ --> enums_clike.rs:28:5
|
28 | A = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^
= note: `-D enum-clike-unportable-variant` implied by `-D warnings`
error: Clike enum variant discriminant is not portable to 32-bit targets
- --> examples/enums_clike.rs:30:5
+ --> enums_clike.rs:30:5
|
30 | C = (std::i32::MIN as isize) - 1,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D enum-clike-unportable-variant` implied by `-D warnings`
error: Clike enum variant discriminant is not portable to 32-bit targets
- --> examples/enums_clike.rs:36:5
+ --> enums_clike.rs:36:5
|
36 | Z = 0xFFFF_FFFF,
| ^^^^^^^^^^^^^^^
= note: `-D enum-clike-unportable-variant` implied by `-D warnings`
error: Clike enum variant discriminant is not portable to 32-bit targets
- --> examples/enums_clike.rs:37:5
+ --> enums_clike.rs:37:5
|
37 | A = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^
error: this boolean expression can be simplified
- --> examples/eq_op.rs:37:5
+ --> eq_op.rs:37:5
|
37 | true && true;
| ^^^^^^^^^^^^ help: try `true`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
- --> examples/eq_op.rs:39:5
+ --> eq_op.rs:39:5
|
39 | true || true;
| ^^^^^^^^^^^^ help: try `true`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
- --> examples/eq_op.rs:45:5
+ --> eq_op.rs:45:5
|
45 | a == b && b == a;
| ^^^^^^^^^^^^^^^^ help: try `a == b`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
- --> examples/eq_op.rs:46:5
+ --> eq_op.rs:46:5
|
46 | a != b && b != a;
| ^^^^^^^^^^^^^^^^ help: try `a != b`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
- --> examples/eq_op.rs:47:5
+ --> eq_op.rs:47:5
|
47 | a < b && b > a;
| ^^^^^^^^^^^^^^ help: try `a < b`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
- --> examples/eq_op.rs:48:5
+ --> eq_op.rs:48:5
|
48 | a <= b && b >= a;
| ^^^^^^^^^^^^^^^^ help: try `a <= b`
= note: `-D nonminimal-bool` implied by `-D warnings`
error: equal expressions as operands to `==`
- --> examples/eq_op.rs:10:5
+ --> eq_op.rs:10:5
|
10 | 1 == 1;
| ^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `==`
- --> examples/eq_op.rs:11:5
+ --> eq_op.rs:11:5
|
11 | "no" == "no";
| ^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `!=`
- --> examples/eq_op.rs:13:5
+ --> eq_op.rs:13:5
|
13 | false != false;
| ^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `<`
- --> examples/eq_op.rs:14:5
+ --> eq_op.rs:14:5
|
14 | 1.5 < 1.5;
| ^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `>=`
- --> examples/eq_op.rs:15:5
+ --> eq_op.rs:15:5
|
15 | 1u64 >= 1u64;
| ^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `&`
- --> examples/eq_op.rs:18:5
+ --> eq_op.rs:18:5
|
18 | (1 as u64) & (1 as u64);
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `^`
- --> examples/eq_op.rs:19:5
+ --> eq_op.rs:19:5
|
19 | 1 ^ ((((((1))))));
| ^^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `<`
- --> examples/eq_op.rs:22:5
+ --> eq_op.rs:22:5
|
22 | (-(2) < -(2));
| ^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `==`
- --> examples/eq_op.rs:23:5
+ --> eq_op.rs:23:5
|
23 | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `&`
- --> examples/eq_op.rs:23:6
+ --> eq_op.rs:23:6
|
23 | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
| ^^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `&`
- --> examples/eq_op.rs:23:27
+ --> eq_op.rs:23:27
|
23 | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
| ^^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `==`
- --> examples/eq_op.rs:24:5
+ --> eq_op.rs:24:5
|
24 | (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `!=`
- --> examples/eq_op.rs:27:5
+ --> eq_op.rs:27:5
|
27 | ([1] != [1]);
| ^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `!=`
- --> examples/eq_op.rs:28:5
+ --> eq_op.rs:28:5
|
28 | ((1, 2) != (1, 2));
| ^^^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `==`
- --> examples/eq_op.rs:32:5
+ --> eq_op.rs:32:5
|
32 | 1 + 1 == 2;
| ^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `==`
- --> examples/eq_op.rs:33:5
+ --> eq_op.rs:33:5
|
33 | 1 - 1 == 0;
| ^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `-`
- --> examples/eq_op.rs:33:5
+ --> eq_op.rs:33:5
|
33 | 1 - 1 == 0;
| ^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `-`
- --> examples/eq_op.rs:35:5
+ --> eq_op.rs:35:5
|
35 | 1 - 1;
| ^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `/`
- --> examples/eq_op.rs:36:5
+ --> eq_op.rs:36:5
|
36 | 1 / 1;
| ^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `&&`
- --> examples/eq_op.rs:37:5
+ --> eq_op.rs:37:5
|
37 | true && true;
| ^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `||`
- --> examples/eq_op.rs:39:5
+ --> eq_op.rs:39:5
|
39 | true || true;
| ^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `&&`
- --> examples/eq_op.rs:45:5
+ --> eq_op.rs:45:5
|
45 | a == b && b == a;
| ^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `&&`
- --> examples/eq_op.rs:46:5
+ --> eq_op.rs:46:5
|
46 | a != b && b != a;
| ^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `&&`
- --> examples/eq_op.rs:47:5
+ --> eq_op.rs:47:5
|
47 | a < b && b > a;
| ^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `&&`
- --> examples/eq_op.rs:48:5
+ --> eq_op.rs:48:5
|
48 | a <= b && b >= a;
| ^^^^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: equal expressions as operands to `==`
- --> examples/eq_op.rs:51:5
+ --> eq_op.rs:51:5
|
51 | a == a;
| ^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: taken reference of right operand
- --> examples/eq_op.rs:89:13
+ --> eq_op.rs:89:13
|
89 | let z = x & &y;
| ^^^^--
error: redundant closure found
- --> examples/eta.rs:7:27
+ --> eta.rs:7:27
|
7 | let a = Some(1u8).map(|a| foo(a));
| ^^^^^^^^^^ help: remove closure as shown: `foo`
= note: `-D redundant-closure` implied by `-D warnings`
error: redundant closure found
- --> examples/eta.rs:8:10
+ --> eta.rs:8:10
|
8 | meta(|a| foo(a));
| ^^^^^^^^^^ help: remove closure as shown: `foo`
= note: `-D redundant-closure` implied by `-D warnings`
error: redundant closure found
- --> examples/eta.rs:9:27
+ --> eta.rs:9:27
|
9 | let c = Some(1u8).map(|a| {1+2; foo}(a));
| ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `{1+2; foo}`
= note: `-D redundant-closure` implied by `-D warnings`
error: this expression borrows a reference that is immediately dereferenced by the compiler
- --> examples/eta.rs:11:21
+ --> eta.rs:11:21
|
11 | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
| ^^^
= note: `-D needless-borrow` implied by `-D warnings`
error: redundant closure found
- --> examples/eta.rs:18:27
+ --> eta.rs:18:27
|
18 | let e = Some(1u8).map(|a| generic(a));
| ^^^^^^^^^^^^^^ help: remove closure as shown: `generic`
error: unsequenced read of a variable
- --> examples/eval_order_dependence.rs:8:28
+ --> eval_order_dependence.rs:8:28
|
8 | let a = { x = 1; 1 } + x;
| ^
|
= note: `-D eval-order-dependence` implied by `-D warnings`
note: whether read occurs before this write depends on evaluation order
- --> examples/eval_order_dependence.rs:8:15
+ --> eval_order_dependence.rs:8:15
|
8 | let a = { x = 1; 1 } + x;
| ^^^^^
error: unsequenced read of a variable
- --> examples/eval_order_dependence.rs:11:5
+ --> eval_order_dependence.rs:11:5
|
11 | x += { x = 20; 2 };
| ^
|
= note: `-D eval-order-dependence` implied by `-D warnings`
note: whether read occurs before this write depends on evaluation order
- --> examples/eval_order_dependence.rs:11:12
+ --> eval_order_dependence.rs:11:12
|
11 | x += { x = 20; 2 };
| ^^^^^^
error: unsequenced read of a variable
- --> examples/eval_order_dependence.rs:17:24
+ --> eval_order_dependence.rs:17:24
|
17 | let foo = Foo { a: x, .. { x = 6; base } };
| ^
|
= note: `-D eval-order-dependence` implied by `-D warnings`
note: whether read occurs before this write depends on evaluation order
- --> examples/eval_order_dependence.rs:17:32
+ --> eval_order_dependence.rs:17:32
|
17 | let foo = Foo { a: x, .. { x = 6; base } };
| ^^^^^
error: unsequenced read of a variable
- --> examples/eval_order_dependence.rs:21:9
+ --> eval_order_dependence.rs:21:9
|
21 | x += { x = 20; 2 };
| ^
|
= note: `-D eval-order-dependence` implied by `-D warnings`
note: whether read occurs before this write depends on evaluation order
- --> examples/eval_order_dependence.rs:21:16
+ --> eval_order_dependence.rs:21:16
|
21 | x += { x = 20; 2 };
| ^^^^^^
error: called `filter(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.filter_map(..)` instead.
- --> examples/filter_methods.rs:8:21
+ --> filter_methods.rs:8:21
|
8 | let _: Vec<_> = vec![5; 6].into_iter()
| _____________________^
= note: `-D filter-map` implied by `-D warnings`
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.
- --> examples/filter_methods.rs:13:21
+ --> filter_methods.rs:13:21
|
13 | let _: Vec<_> = vec![5_i8; 6].into_iter()
| _____________________^
= note: `-D filter-map` implied by `-D warnings`
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.
- --> examples/filter_methods.rs:18:21
+ --> filter_methods.rs:18:21
|
18 | let _: Vec<_> = vec![5_i8; 6].into_iter()
| _____________________^
= note: `-D filter-map` implied by `-D warnings`
error: called `filter_map(p).map(q)` on an `Iterator`. This is more succinctly expressed by only calling `.filter_map(..)` instead.
- --> examples/filter_methods.rs:23:21
+ --> filter_methods.rs:23:21
|
23 | let _: Vec<_> = vec![5_i8; 6].into_iter()
| _____________________^
error: strict comparison of f32 or f64
- --> examples/float_cmp.rs:43:5
+ --> float_cmp.rs:43:5
|
43 | ONE == 1f32;
| ^^^^^^^^^^^ help: consider comparing them within some error `(ONE - 1f32).abs() < error`
|
= note: `-D float-cmp` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
- --> examples/float_cmp.rs:43:5
+ --> float_cmp.rs:43:5
|
43 | ONE == 1f32;
| ^^^^^^^^^^^
error: strict comparison of f32 or f64
- --> examples/float_cmp.rs:44:5
+ --> float_cmp.rs:44:5
|
44 | ONE == 1.0 + 0.0;
| ^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE - (1.0 + 0.0)).abs() < error`
|
= note: `-D float-cmp` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
- --> examples/float_cmp.rs:44:5
+ --> float_cmp.rs:44:5
|
44 | ONE == 1.0 + 0.0;
| ^^^^^^^^^^^^^^^^
error: strict comparison of f32 or f64
- --> examples/float_cmp.rs:45:5
+ --> float_cmp.rs:45:5
|
45 | ONE + ONE == ZERO + ONE + ONE;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE + ONE - (ZERO + ONE + ONE)).abs() < error`
|
= note: `-D float-cmp` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
- --> examples/float_cmp.rs:45:5
+ --> float_cmp.rs:45:5
|
45 | ONE + ONE == ZERO + ONE + ONE;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: strict comparison of f32 or f64
- --> examples/float_cmp.rs:46:5
+ --> float_cmp.rs:46:5
|
46 | ONE != 2.0;
| ^^^^^^^^^^ help: consider comparing them within some error `(ONE - 2.0).abs() < error`
|
= note: `-D float-cmp` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
- --> examples/float_cmp.rs:46:5
+ --> float_cmp.rs:46:5
|
46 | ONE != 2.0;
| ^^^^^^^^^^
error: strict comparison of f32 or f64
- --> examples/float_cmp.rs:48:5
+ --> float_cmp.rs:48:5
|
48 | twice(ONE) != ONE;
| ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(twice(ONE) - ONE).abs() < error`
|
= note: `-D float-cmp` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
- --> examples/float_cmp.rs:48:5
+ --> float_cmp.rs:48:5
|
48 | twice(ONE) != ONE;
| ^^^^^^^^^^^^^^^^^
error: strict comparison of f32 or f64
- --> examples/float_cmp.rs:49:5
+ --> float_cmp.rs:49:5
|
49 | ONE as f64 != 2.0;
| ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE as f64 - 2.0).abs() < error`
|
= note: `-D float-cmp` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
- --> examples/float_cmp.rs:49:5
+ --> float_cmp.rs:49:5
|
49 | ONE as f64 != 2.0;
| ^^^^^^^^^^^^^^^^^
error: strict comparison of f32 or f64
- --> examples/float_cmp.rs:54:5
+ --> float_cmp.rs:54:5
|
54 | x == 1.0;
| ^^^^^^^^ help: consider comparing them within some error `(x - 1.0).abs() < error`
|
= note: `-D float-cmp` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
- --> examples/float_cmp.rs:54:5
+ --> float_cmp.rs:54:5
|
54 | x == 1.0;
| ^^^^^^^^
error: strict comparison of f32 or f64
- --> examples/float_cmp.rs:57:5
+ --> float_cmp.rs:57:5
|
57 | twice(x) != twice(ONE as f64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(twice(x) - twice(ONE as f64)).abs() < error`
|
= note: `-D float-cmp` implied by `-D warnings`
note: std::f32::EPSILON and std::f64::EPSILON are available.
- --> examples/float_cmp.rs:57:5
+ --> float_cmp.rs:57:5
|
57 | twice(x) != twice(ONE as f64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement.
- --> examples/for_loop.rs:17:14
+ --> for_loop.rs:17:14
|
17 | for x in option {
| ^^^^^^
= help: consider replacing `for x in option` with `if let Some(x) = option`
error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement.
- --> examples/for_loop.rs:22:14
+ --> for_loop.rs:22:14
|
22 | for x in result {
| ^^^^^^
= help: consider replacing `for x in result` with `if let Ok(x) = result`
error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
- --> examples/for_loop.rs:26:14
+ --> for_loop.rs:26:14
|
26 | 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")`
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
- --> examples/for_loop.rs:31:5
+ --> for_loop.rs:31:5
|
31 | / for x in v.iter().next() {
32 | | println!("{}", x);
= note: `-D iter-next-loop` implied by `-D warnings`
error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This is more readably written as an `if let` statement.
- --> examples/for_loop.rs:36:14
+ --> for_loop.rs:36:14
|
36 | 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))`
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.
- --> examples/for_loop.rs:40:14
+ --> for_loop.rs:40:14
|
40 | 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")`
error: the loop variable `i` is only used to index `vec`.
- --> examples/for_loop.rs:84:5
+ --> for_loop.rs:84:5
|
84 | / for i in 0..vec.len() {
85 | | println!("{}", vec[i]);
| for <item> in &vec {
error: unused variable: `i`
- --> examples/for_loop.rs:88:9
+ --> for_loop.rs:88:9
|
88 | for i in 0..vec.len() {
| ^
= note: `-D unused-variables` implied by `-D warnings`
error: the loop variable `i` is only used to index `vec`.
- --> examples/for_loop.rs:93:5
+ --> for_loop.rs:93:5
|
93 | for i in 0..vec.len() { let _ = vec[i]; }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| for <item> in &vec { let _ = vec[i]; }
error: the loop variable `j` is only used to index `STATIC`.
- --> examples/for_loop.rs:96:5
+ --> for_loop.rs:96:5
|
96 | / for j in 0..4 {
97 | | println!("{:?}", STATIC[j]);
| for <item> in STATIC.iter().take(4) {
error: the loop variable `j` is only used to index `CONST`.
- --> examples/for_loop.rs:100:5
+ --> for_loop.rs:100:5
|
100 | / for j in 0..4 {
101 | | println!("{:?}", CONST[j]);
| for <item> in CONST.iter().take(4) {
error: the loop variable `i` is used to index `vec`
- --> examples/for_loop.rs:104:5
+ --> for_loop.rs:104:5
|
104 | / for i in 0..vec.len() {
105 | | println!("{} {}", vec[i], i);
| for (i, <item>) in vec.iter().enumerate() {
error: the loop variable `i` is only used to index `vec2`.
- --> examples/for_loop.rs:111:5
+ --> for_loop.rs:111:5
|
111 | / for i in 0..vec.len() {
112 | | println!("{}", vec2[i]);
| for <item> in vec2.iter().take(vec.len()) {
error: the loop variable `i` is only used to index `vec`.
- --> examples/for_loop.rs:115:5
+ --> for_loop.rs:115:5
|
115 | / for i in 5..vec.len() {
116 | | println!("{}", vec[i]);
| for <item> in vec.iter().skip(5) {
error: the loop variable `i` is only used to index `vec`.
- --> examples/for_loop.rs:119:5
+ --> for_loop.rs:119:5
|
119 | / for i in 0..MAX_LEN {
120 | | println!("{}", vec[i]);
| for <item> in vec.iter().take(MAX_LEN) {
error: the loop variable `i` is only used to index `vec`.
- --> examples/for_loop.rs:123:5
+ --> for_loop.rs:123:5
|
123 | / for i in 0...MAX_LEN {
124 | | println!("{}", vec[i]);
| for <item> in vec.iter().take(MAX_LEN + 1) {
error: the loop variable `i` is only used to index `vec`.
- --> examples/for_loop.rs:127:5
+ --> for_loop.rs:127:5
|
127 | / for i in 5..10 {
128 | | println!("{}", vec[i]);
| for <item> in vec.iter().take(10).skip(5) {
error: the loop variable `i` is only used to index `vec`.
- --> examples/for_loop.rs:131:5
+ --> for_loop.rs:131:5
|
131 | / for i in 5...10 {
132 | | println!("{}", vec[i]);
| for <item> in vec.iter().take(10 + 1).skip(5) {
error: the loop variable `i` is used to index `vec`
- --> examples/for_loop.rs:135:5
+ --> for_loop.rs:135:5
|
135 | / for i in 5..vec.len() {
136 | | println!("{} {}", vec[i], i);
| for (i, <item>) in vec.iter().enumerate().skip(5) {
error: the loop variable `i` is used to index `vec`
- --> examples/for_loop.rs:139:5
+ --> for_loop.rs:139:5
|
139 | / for i in 5..10 {
140 | | println!("{} {}", vec[i], i);
| for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
error: this range is empty so this for loop will never run
- --> examples/for_loop.rs:143:5
+ --> for_loop.rs:143:5
|
143 | / for i in 10..0 {
144 | | println!("{}", i);
| for i in (0..10).rev() {
error: this range is empty so this for loop will never run
- --> examples/for_loop.rs:147:5
+ --> for_loop.rs:147:5
|
147 | / for i in 10...0 {
148 | | println!("{}", i);
| for i in (0...10).rev() {
error: this range is empty so this for loop will never run
- --> examples/for_loop.rs:151:5
+ --> for_loop.rs:151:5
|
151 | / for i in MAX_LEN..0 {
152 | | println!("{}", i);
| for i in (0..MAX_LEN).rev() {
error: this range is empty so this for loop will never run
- --> examples/for_loop.rs:155:5
+ --> for_loop.rs:155:5
|
155 | / for i in 5..5 {
156 | | println!("{}", i);
= note: `-D reverse-range-loop` implied by `-D warnings`
error: this range is empty so this for loop will never run
- --> examples/for_loop.rs:176:5
+ --> for_loop.rs:176:5
|
176 | / for i in 10..5+4 {
177 | | println!("{}", i);
| for i in (5+4..10).rev() {
error: this range is empty so this for loop will never run
- --> examples/for_loop.rs:180:5
+ --> for_loop.rs:180:5
|
180 | / for i in (5+2)..(3-1) {
181 | | println!("{}", i);
| for i in ((3-1)..(5+2)).rev() {
error: this range is empty so this for loop will never run
- --> examples/for_loop.rs:184:5
+ --> for_loop.rs:184:5
|
184 | / for i in (5+2)..(8-1) {
185 | | println!("{}", i);
= note: `-D reverse-range-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:207:15
+ --> for_loop.rs:207:15
|
207 | for _v in vec.iter() { }
| ^^^^^^^^^^ help: to write this more concisely, try `&vec`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:209:15
+ --> for_loop.rs:209:15
|
209 | for _v in vec.iter_mut() { }
| ^^^^^^^^^^^^^^ help: to write this more concisely, try `&mut vec`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over containers instead of using explicit iteration methods`
- --> examples/for_loop.rs:212:15
+ --> for_loop.rs:212:15
|
212 | for _v in out_vec.into_iter() { }
| ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try `out_vec`
= note: `-D explicit-into-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:215:15
+ --> for_loop.rs:215:15
|
215 | for _v in array.into_iter() {}
| ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try `&array`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:220:15
+ --> for_loop.rs:220:15
|
220 | for _v in [1, 2, 3].iter() { }
| ^^^^^^^^^^^^^^^^ help: to write this more concisely, try `&[1, 2, 3]`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:224:15
+ --> for_loop.rs:224:15
|
224 | for _v in [0; 32].iter() {}
| ^^^^^^^^^^^^^^ help: to write this more concisely, try `&[0; 32]`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:229:15
+ --> for_loop.rs:229:15
|
229 | for _v in ll.iter() { }
| ^^^^^^^^^ help: to write this more concisely, try `&ll`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:232:15
+ --> for_loop.rs:232:15
|
232 | for _v in vd.iter() { }
| ^^^^^^^^^ help: to write this more concisely, try `&vd`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:235:15
+ --> for_loop.rs:235:15
|
235 | for _v in bh.iter() { }
| ^^^^^^^^^ help: to write this more concisely, try `&bh`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:238:15
+ --> for_loop.rs:238:15
|
238 | for _v in hm.iter() { }
| ^^^^^^^^^ help: to write this more concisely, try `&hm`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:241:15
+ --> for_loop.rs:241:15
|
241 | for _v in bt.iter() { }
| ^^^^^^^^^ help: to write this more concisely, try `&bt`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:244:15
+ --> for_loop.rs:244:15
|
244 | for _v in hs.iter() { }
| ^^^^^^^^^ help: to write this more concisely, try `&hs`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
- --> examples/for_loop.rs:247:15
+ --> for_loop.rs:247:15
|
247 | for _v in bs.iter() { }
| ^^^^^^^^^ help: to write this more concisely, try `&bs`
= note: `-D explicit-iter-loop` implied by `-D warnings`
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
- --> examples/for_loop.rs:249:5
+ --> for_loop.rs:249:5
|
249 | for _v in vec.iter().next() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D 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
- --> examples/for_loop.rs:256:5
+ --> for_loop.rs:256:5
|
256 | vec.iter().map(|x| out.push(x)).collect::<Vec<_>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D unused-collect` implied by `-D warnings`
error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
- --> examples/for_loop.rs:261:5
+ --> for_loop.rs:261:5
|
261 | for _v in &vec { _index += 1 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D explicit-counter-loop` implied by `-D warnings`
error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
- --> examples/for_loop.rs:265:5
+ --> for_loop.rs:265:5
|
265 | for _v in &vec { _index += 1 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D explicit-counter-loop` implied by `-D warnings`
error: you seem to want to iterate on a map's values
- --> examples/for_loop.rs:325:5
+ --> for_loop.rs:325:5
|
325 | / for (_, v) in &m {
326 | | let _v = v;
| for v in m.values() {
error: you seem to want to iterate on a map's values
- --> examples/for_loop.rs:330:5
+ --> for_loop.rs:330:5
|
330 | / for (_, v) in &*m {
331 | | let _v = v;
| for v in (*m).values() {
error: you seem to want to iterate on a map's values
- --> examples/for_loop.rs:337:5
+ --> for_loop.rs:337:5
|
337 | / for (_, v) in &mut m {
338 | | let _v = v;
| for v in m.values_mut() {
error: you seem to want to iterate on a map's values
- --> examples/for_loop.rs:342:5
+ --> for_loop.rs:342:5
|
342 | / for (_, v) in &mut *m {
343 | | let _v = v;
| for v in (*m).values_mut() {
error: you seem to want to iterate on a map's keys
- --> examples/for_loop.rs:348:5
+ --> for_loop.rs:348:5
|
348 | / for (k, _value) in rm {
349 | | let _k = k;
error: useless use of `format!`
- --> examples/format.rs:6:5
+ --> format.rs:6:5
|
6 | format!("foo");
| ^^^^^^^^^^^^^^^
= note: `-D useless-format` implied by `-D warnings`
error: useless use of `format!`
- --> examples/format.rs:8:5
+ --> format.rs:8:5
|
8 | format!("{}", "foo");
| ^^^^^^^^^^^^^^^^^^^^^
= note: `-D useless-format` implied by `-D warnings`
error: useless use of `format!`
- --> examples/format.rs:15:5
+ --> format.rs:15:5
|
15 | format!("{}", arg);
| ^^^^^^^^^^^^^^^^^^^
error: this looks like an `else if` but the `else` is missing
- --> examples/formatting.rs:15:6
+ --> formatting.rs:15:6
|
15 | } if foo() {
| ^
= note: to remove this lint, add the missing `else` or add a new line before the second `if`
error: this looks like an `else if` but the `else` is missing
- --> examples/formatting.rs:22:10
+ --> formatting.rs:22:10
|
22 | } if foo() {
| ^
= note: to remove this lint, add the missing `else` or add a new line before the second `if`
error: this looks like an `else if` but the `else` is missing
- --> examples/formatting.rs:30:10
+ --> formatting.rs:30:10
|
30 | } if foo() {
| ^
= note: to remove this lint, add the missing `else` or add a new line before the second `if`
error: this is an `else if` but the formatting might hide it
- --> examples/formatting.rs:39:6
+ --> formatting.rs:39:6
|
39 | } else
| ______^
= note: to remove this lint, remove the `else` or remove the new line between `else` and `if`
error: this is an `else if` but the formatting might hide it
- --> examples/formatting.rs:44:6
+ --> formatting.rs:44:6
|
44 | }
| ______^
= 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 `.. = (- ..)`
- --> examples/formatting.rs:71:6
+ --> formatting.rs:71:6
|
71 | a =- 35;
| ^^^^
= note: to remove this lint, use either `-=` or `= -`
error: this looks like you are trying to use `.. *= ..`, but you really are doing `.. = (* ..)`
- --> examples/formatting.rs:72:6
+ --> formatting.rs:72:6
|
72 | a =* &191;
| ^^^^
= note: to remove this lint, use either `*=` or `= *`
error: this looks like you are trying to use `.. != ..`, but you really are doing `.. = (! ..)`
- --> examples/formatting.rs:75:6
+ --> formatting.rs:75:6
|
75 | b =! false;
| ^^^^
= note: to remove this lint, use either `!=` or `= !`
error: possibly missing a comma here
- --> examples/formatting.rs:84:19
+ --> formatting.rs:84:19
|
84 | -1, -2, -3 // <= no comma here
| ^
= note: to remove this lint, add a comma or write the expr in a single line
error: possibly missing a comma here
- --> examples/formatting.rs:88:19
+ --> formatting.rs:88:19
|
88 | -1, -2, -3 // <= no comma here
| ^
error: this function has too many arguments (8/7)
- --> examples/functions.rs:11:1
+ --> functions.rs:11:1
|
11 | / fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {
12 | | }
= note: `-D too-many-arguments` implied by `-D warnings`
error: this function has too many arguments (8/7)
- --> examples/functions.rs:19:5
+ --> functions.rs:19:5
|
19 | fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D too-many-arguments` implied by `-D warnings`
error: this function has too many arguments (8/7)
- --> examples/functions.rs:28:5
+ --> functions.rs:28:5
|
28 | fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D too-many-arguments` implied by `-D warnings`
error: this public function dereferences a raw pointer but is not marked `unsafe`
- --> examples/functions.rs:37:34
+ --> functions.rs:37:34
|
37 | println!("{}", unsafe { *p });
| ^
= note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings`
error: this public function dereferences a raw pointer but is not marked `unsafe`
- --> examples/functions.rs:38:35
+ --> functions.rs:38:35
|
38 | println!("{:?}", unsafe { p.as_ref() });
| ^
= note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings`
error: this public function dereferences a raw pointer but is not marked `unsafe`
- --> examples/functions.rs:39:33
+ --> functions.rs:39:33
|
39 | unsafe { std::ptr::read(p) };
| ^
= note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings`
error: this public function dereferences a raw pointer but is not marked `unsafe`
- --> examples/functions.rs:50:30
+ --> functions.rs:50:30
|
50 | println!("{}", unsafe { *p });
| ^
= note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings`
error: this public function dereferences a raw pointer but is not marked `unsafe`
- --> examples/functions.rs:51:31
+ --> functions.rs:51:31
|
51 | println!("{:?}", unsafe { p.as_ref() });
| ^
= note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings`
error: this public function dereferences a raw pointer but is not marked `unsafe`
- --> examples/functions.rs:52:29
+ --> functions.rs:52:29
|
52 | unsafe { std::ptr::read(p) };
| ^
= note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings`
error: this public function dereferences a raw pointer but is not marked `unsafe`
- --> examples/functions.rs:61:34
+ --> functions.rs:61:34
|
61 | println!("{}", unsafe { *p });
| ^
= note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings`
error: this public function dereferences a raw pointer but is not marked `unsafe`
- --> examples/functions.rs:62:35
+ --> functions.rs:62:35
|
62 | println!("{:?}", unsafe { p.as_ref() });
| ^
= note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings`
error: this public function dereferences a raw pointer but is not marked `unsafe`
- --> examples/functions.rs:63:33
+ --> functions.rs:63:33
|
63 | unsafe { std::ptr::read(p) };
| ^
error: the operation is ineffective. Consider reducing it to `x`
- --> examples/identity_op.rs:13:5
+ --> identity_op.rs:13:5
|
13 | x + 0;
| ^^^^^
= note: `-D identity-op` implied by `-D warnings`
error: the operation is ineffective. Consider reducing it to `x`
- --> examples/identity_op.rs:14:5
+ --> identity_op.rs:14:5
|
14 | x + (1 - 1);
| ^^^^^^^^^^^
= note: `-D identity-op` implied by `-D warnings`
error: the operation is ineffective. Consider reducing it to `x`
- --> examples/identity_op.rs:16:5
+ --> identity_op.rs:16:5
|
16 | 0 + x;
| ^^^^^
= note: `-D identity-op` implied by `-D warnings`
error: the operation is ineffective. Consider reducing it to `x`
- --> examples/identity_op.rs:19:5
+ --> identity_op.rs:19:5
|
19 | x | (0);
| ^^^^^^^
= note: `-D identity-op` implied by `-D warnings`
error: the operation is ineffective. Consider reducing it to `x`
- --> examples/identity_op.rs:22:5
+ --> identity_op.rs:22:5
|
22 | x * 1;
| ^^^^^
= note: `-D identity-op` implied by `-D warnings`
error: the operation is ineffective. Consider reducing it to `x`
- --> examples/identity_op.rs:23:5
+ --> identity_op.rs:23:5
|
23 | 1 * x;
| ^^^^^
= note: `-D identity-op` implied by `-D warnings`
error: the operation is ineffective. Consider reducing it to `x`
- --> examples/identity_op.rs:29:5
+ --> identity_op.rs:29:5
|
29 | -1 & x;
| ^^^^^^
error: redundant pattern matching, consider using `is_ok()`
- --> examples/if_let_redundant_pattern_matching.rs:9:12
+ --> if_let_redundant_pattern_matching.rs:9:12
|
9 | if let Ok(_) = Ok::<i32, i32>(42) {}
| -------^^^^^--------------------- help: try this `if Ok::<i32, i32>(42).is_ok()`
= note: `-D if-let-redundant-pattern-matching` implied by `-D warnings`
error: redundant pattern matching, consider using `is_err()`
- --> examples/if_let_redundant_pattern_matching.rs:11:12
+ --> if_let_redundant_pattern_matching.rs:11:12
|
11 | if let Err(_) = Err::<i32, i32>(42) {
| -------^^^^^^---------------------- help: try this `if Err::<i32, i32>(42).is_err()`
= note: `-D if-let-redundant-pattern-matching` implied by `-D warnings`
error: redundant pattern matching, consider using `is_none()`
- --> examples/if_let_redundant_pattern_matching.rs:14:12
+ --> if_let_redundant_pattern_matching.rs:14:12
|
14 | if let None = None::<()> {
| -------^^^^------------- help: try this `if None::<()>.is_none()`
= note: `-D if-let-redundant-pattern-matching` implied by `-D warnings`
error: redundant pattern matching, consider using `is_some()`
- --> examples/if_let_redundant_pattern_matching.rs:17:12
+ --> if_let_redundant_pattern_matching.rs:17:12
|
17 | if let Some(_) = Some(42) {
| -------^^^^^^^----------- help: try this `if Some(42).is_some()`
error: Unnecessary boolean `not` operation
- --> examples/if_not_else.rs:9:5
+ --> if_not_else.rs:9:5
|
9 | / if !bla() {
10 | | println!("Bugs");
= help: remove the `!` and swap the blocks of the if/else
error: Unnecessary `!=` operation
- --> examples/if_not_else.rs:14:5
+ --> if_not_else.rs:14:5
|
14 | / if 4 != 5 {
15 | | println!("Bugs");
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:16:5
+ --> invalid_upcast_comparisons.rs:16:5
|
16 | (u8 as u32) > 300;
| ^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:17:5
+ --> invalid_upcast_comparisons.rs:17:5
|
17 | (u8 as i32) > 300;
| ^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:18:5
+ --> invalid_upcast_comparisons.rs:18:5
|
18 | (u8 as u32) == 300;
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:19:5
+ --> invalid_upcast_comparisons.rs:19:5
|
19 | (u8 as i32) == 300;
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:20:5
+ --> invalid_upcast_comparisons.rs:20:5
|
20 | 300 < (u8 as u32);
| ^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:21:5
+ --> invalid_upcast_comparisons.rs:21:5
|
21 | 300 < (u8 as i32);
| ^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:22:5
+ --> invalid_upcast_comparisons.rs:22:5
|
22 | 300 == (u8 as u32);
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:23:5
+ --> invalid_upcast_comparisons.rs:23:5
|
23 | 300 == (u8 as i32);
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:25:5
+ --> invalid_upcast_comparisons.rs:25:5
|
25 | (u8 as u32) <= 300;
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:26:5
+ --> invalid_upcast_comparisons.rs:26:5
|
26 | (u8 as i32) <= 300;
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:27:5
+ --> invalid_upcast_comparisons.rs:27:5
|
27 | (u8 as u32) != 300;
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:28:5
+ --> invalid_upcast_comparisons.rs:28:5
|
28 | (u8 as i32) != 300;
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:29:5
+ --> invalid_upcast_comparisons.rs:29:5
|
29 | 300 >= (u8 as u32);
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:30:5
+ --> invalid_upcast_comparisons.rs:30:5
|
30 | 300 >= (u8 as i32);
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:31:5
+ --> invalid_upcast_comparisons.rs:31:5
|
31 | 300 != (u8 as u32);
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:32:5
+ --> invalid_upcast_comparisons.rs:32:5
|
32 | 300 != (u8 as i32);
| ^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:35:5
+ --> invalid_upcast_comparisons.rs:35:5
|
35 | (u8 as i32) < 0;
| ^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:36:5
+ --> invalid_upcast_comparisons.rs:36:5
|
36 | -5 != (u8 as i32);
| ^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:38:5
+ --> invalid_upcast_comparisons.rs:38:5
|
38 | (u8 as i32) >= 0;
| ^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:39:5
+ --> invalid_upcast_comparisons.rs:39:5
|
39 | -5 == (u8 as i32);
| ^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:42:5
+ --> invalid_upcast_comparisons.rs:42:5
|
42 | 1337 == (u8 as i32);
| ^^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:43:5
+ --> invalid_upcast_comparisons.rs:43:5
|
43 | 1337 == (u8 as u32);
| ^^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:45:5
+ --> invalid_upcast_comparisons.rs:45:5
|
45 | 1337 != (u8 as i32);
| ^^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:46:5
+ --> invalid_upcast_comparisons.rs:46:5
|
46 | 1337 != (u8 as u32);
| ^^^^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always true
- --> examples/invalid_upcast_comparisons.rs:61:5
+ --> invalid_upcast_comparisons.rs:61:5
|
61 | (u8 as i32) > -1;
| ^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:62:5
+ --> invalid_upcast_comparisons.rs:62:5
|
62 | (u8 as i32) < -1;
| ^^^^^^^^^^^^^^^^
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
- --> examples/invalid_upcast_comparisons.rs:78:5
+ --> invalid_upcast_comparisons.rs:78:5
|
78 | -5 >= (u8 as i32);
| ^^^^^^^^^^^^^^^^^
error: adding items after statements is confusing, since items exist from the start of the scope
- --> examples/item_after_statement.rs:12:5
+ --> item_after_statement.rs:12:5
|
12 | fn foo() { println!("foo"); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D items-after-statements` implied by `-D warnings`
error: adding items after statements is confusing, since items exist from the start of the scope
- --> examples/item_after_statement.rs:17:5
+ --> item_after_statement.rs:17:5
|
17 | fn foo() { println!("foo"); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: large size difference between variants
- --> examples/large_enum_variant.rs:10:5
+ --> large_enum_variant.rs:10:5
|
10 | B([i32; 8000]),
| ^^^^^^^^^^^^^^
| B(Box<[i32; 8000]>),
error: large size difference between variants
- --> examples/large_enum_variant.rs:21:5
+ --> large_enum_variant.rs:21:5
|
21 | C(T, [i32; 8000]),
| ^^^^^^^^^^^^^^^^^
|
= note: `-D large-enum-variant` implied by `-D warnings`
help: consider boxing the large fields to reduce the total size of the enum
- --> examples/large_enum_variant.rs:21:5
+ --> large_enum_variant.rs:21:5
|
21 | C(T, [i32; 8000]),
| ^^^^^^^^^^^^^^^^^
error: large size difference between variants
- --> examples/large_enum_variant.rs:34:5
+ --> large_enum_variant.rs:34:5
|
34 | ContainingLargeEnum(LargeEnum),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ContainingLargeEnum(Box<LargeEnum>),
error: large size difference between variants
- --> examples/large_enum_variant.rs:37:5
+ --> large_enum_variant.rs:37:5
|
37 | ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D large-enum-variant` implied by `-D warnings`
help: consider boxing the large fields to reduce the total size of the enum
- --> examples/large_enum_variant.rs:37:5
+ --> large_enum_variant.rs:37:5
|
37 | ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: large size difference between variants
- --> examples/large_enum_variant.rs:44:5
+ --> large_enum_variant.rs:44:5
|
44 | StructLikeLarge { x: [i32; 8000], y: i32 },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D large-enum-variant` implied by `-D warnings`
help: consider boxing the large fields to reduce the total size of the enum
- --> examples/large_enum_variant.rs:44:5
+ --> large_enum_variant.rs:44:5
|
44 | StructLikeLarge { x: [i32; 8000], y: i32 },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: large size difference between variants
- --> examples/large_enum_variant.rs:49:5
+ --> large_enum_variant.rs:49:5
|
49 | StructLikeLarge2 { x: [i32; 8000] },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: item `PubOne` has a public `len` method but no corresponding `is_empty` method
- --> examples/len_zero.rs:9:1
+ --> len_zero.rs:9:1
|
9 | / impl PubOne {
10 | | pub fn len(self: &Self) -> isize {
= note: `-D len-without-is-empty` implied by `-D warnings`
error: trait `PubTraitsToo` has a `len` method but no `is_empty` method
- --> examples/len_zero.rs:55:1
+ --> len_zero.rs:55:1
|
55 | / pub trait PubTraitsToo {
56 | | fn len(self: &Self) -> isize;
= note: `-D len-without-is-empty` implied by `-D warnings`
error: item `HasIsEmpty` has a public `len` method but a private `is_empty` method
- --> examples/len_zero.rs:89:1
+ --> len_zero.rs:89:1
|
89 | / impl HasIsEmpty {
90 | | pub fn len(self: &Self) -> isize {
= note: `-D len-without-is-empty` implied by `-D warnings`
error: item `HasWrongIsEmpty` has a public `len` method but no corresponding `is_empty` method
- --> examples/len_zero.rs:118:1
+ --> len_zero.rs:118:1
|
118 | / impl HasWrongIsEmpty {
119 | | pub fn len(self: &Self) -> isize {
= note: `-D len-without-is-empty` implied by `-D warnings`
error: length comparison to zero
- --> examples/len_zero.rs:130:8
+ --> len_zero.rs:130:8
|
130 | if x.len() == 0 {
| ^^^^^^^^^^^^ help: using `is_empty` is more concise: `x.is_empty()`
= note: `-D len-zero` implied by `-D warnings`
error: length comparison to zero
- --> examples/len_zero.rs:134:8
+ --> len_zero.rs:134:8
|
134 | if "".len() == 0 {
| ^^^^^^^^^^^^^ help: using `is_empty` is more concise: `"".is_empty()`
= note: `-D len-zero` implied by `-D warnings`
error: length comparison to zero
- --> examples/len_zero.rs:148:8
+ --> len_zero.rs:148:8
|
148 | if has_is_empty.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `has_is_empty.is_empty()`
= note: `-D len-zero` implied by `-D warnings`
error: length comparison to zero
- --> examples/len_zero.rs:151:8
+ --> len_zero.rs:151:8
|
151 | if has_is_empty.len() != 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
= note: `-D len-zero` implied by `-D warnings`
error: length comparison to zero
- --> examples/len_zero.rs:154:8
+ --> len_zero.rs:154:8
|
154 | if has_is_empty.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
= note: `-D len-zero` implied by `-D warnings`
error: length comparison to zero
- --> examples/len_zero.rs:160:8
+ --> len_zero.rs:160:8
|
160 | if with_is_empty.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `with_is_empty.is_empty()`
= note: `-D len-zero` implied by `-D warnings`
error: length comparison to zero
- --> examples/len_zero.rs:172:8
+ --> len_zero.rs:172:8
|
172 | if b.len() != 0 {
| ^^^^^^^^^^^^ help: using `is_empty` is more concise: `!b.is_empty()`
error: `if _ { .. } else { .. }` is an expression
- --> examples/let_if_seq.rs:57:5
+ --> let_if_seq.rs:57:5
|
57 | / let mut foo = 0;
58 | | if f() {
= note: you might not need `mut` at all
error: `if _ { .. } else { .. }` is an expression
- --> examples/let_if_seq.rs:62:5
+ --> let_if_seq.rs:62:5
|
62 | / let mut bar = 0;
63 | | if f() {
= note: you might not need `mut` at all
error: `if _ { .. } else { .. }` is an expression
- --> examples/let_if_seq.rs:71:5
+ --> let_if_seq.rs:71:5
|
71 | / let quz;
72 | | if f() {
= note: `-D useless-let-if-seq` implied by `-D warnings`
error: `if _ { .. } else { .. }` is an expression
- --> examples/let_if_seq.rs:100:5
+ --> let_if_seq.rs:100:5
|
100 | / let mut baz = 0;
101 | | if f() {
error: returning the result of a let binding from a block. Consider returning the expression directly.
- --> examples/let_return.rs:10:5
+ --> let_return.rs:10:5
|
10 | x
| ^
|
= note: `-D let-and-return` implied by `-D warnings`
note: this expression can be directly returned
- --> examples/let_return.rs:9:13
+ --> let_return.rs:9:13
|
9 | let x = 5;
| ^
error: returning the result of a let binding from a block. Consider returning the expression directly.
- --> examples/let_return.rs:16:9
+ --> let_return.rs:16:9
|
16 | x
| ^
|
= note: `-D let-and-return` implied by `-D warnings`
note: this expression can be directly returned
- --> examples/let_return.rs:15:17
+ --> let_return.rs:15:17
|
15 | let x = 5;
| ^
error: this let-binding has unit value. Consider omitting `let _x =`
- --> examples/let_unit.rs:14:5
+ --> let_unit.rs:14:5
|
14 | let _x = println!("x");
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D let-unit-value` implied by `-D warnings`
error: this let-binding has unit value. Consider omitting `let _a =`
- --> examples/let_unit.rs:18:9
+ --> let_unit.rs:18:9
|
18 | let _a = ();
| ^^^^^^^^^^^^
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:7:1
+ --> lifetimes.rs:7:1
|
7 | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:9:1
+ --> lifetimes.rs:9:1
|
9 | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:17:1
+ --> lifetimes.rs:17:1
|
17 | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 { x }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:29:1
+ --> lifetimes.rs:29:1
|
29 | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> { Ok(x) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:32:1
+ --> lifetimes.rs:32:1
|
32 | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> where T: Copy { Ok(x) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:38:1
+ --> lifetimes.rs:38:1
|
38 | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:52:1
+ --> lifetimes.rs:52:1
|
52 | / fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
53 | | where for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:61:5
+ --> lifetimes.rs:61:5
|
61 | fn self_and_out<'s>(&'s self) -> &'s u8 { &self.x }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:65:5
+ --> lifetimes.rs:65:5
|
65 | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:81:1
+ --> lifetimes.rs:81:1
|
81 | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:101:1
+ --> lifetimes.rs:101:1
|
101 | fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:105:1
+ --> lifetimes.rs:105:1
|
105 | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:116:1
+ --> lifetimes.rs:116:1
|
116 | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided
- --> examples/lifetimes.rs:120:1
+ --> lifetimes.rs:120:1
|
120 | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the lint `MISSING_LINT` is not added to any `LintPass`
- --> examples/lint_pass.rs:12:1
+ --> lint_pass.rs:12:1
|
12 | declare_lint! { MISSING_LINT, Warn, "missing lint" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: inconsistent casing in hexadecimal literal
- --> examples/literals.rs:14:17
+ --> literals.rs:14:17
|
14 | let fail1 = 0xabCD;
| ^^^^^^
= note: `-D mixed-case-hex-literals` implied by `-D warnings`
error: inconsistent casing in hexadecimal literal
- --> examples/literals.rs:15:17
+ --> literals.rs:15:17
|
15 | let fail2 = 0xabCD_u32;
| ^^^^^^^^^^
= note: `-D mixed-case-hex-literals` implied by `-D warnings`
error: inconsistent casing in hexadecimal literal
- --> examples/literals.rs:16:17
+ --> literals.rs:16:17
|
16 | let fail2 = 0xabCD_isize;
| ^^^^^^^^^^^^
= note: `-D mixed-case-hex-literals` implied by `-D warnings`
error: integer type suffix should be separated by an underscore
- --> examples/literals.rs:21:17
+ --> literals.rs:21:17
|
21 | let fail3 = 1234i32;
| ^^^^^^^
= note: `-D unseparated-literal-suffix` implied by `-D warnings`
error: integer type suffix should be separated by an underscore
- --> examples/literals.rs:22:17
+ --> literals.rs:22:17
|
22 | let fail4 = 1234u32;
| ^^^^^^^
= note: `-D unseparated-literal-suffix` implied by `-D warnings`
error: integer type suffix should be separated by an underscore
- --> examples/literals.rs:23:17
+ --> literals.rs:23:17
|
23 | let fail5 = 1234isize;
| ^^^^^^^^^
= note: `-D unseparated-literal-suffix` implied by `-D warnings`
error: integer type suffix should be separated by an underscore
- --> examples/literals.rs:24:17
+ --> literals.rs:24:17
|
24 | let fail6 = 1234usize;
| ^^^^^^^^^
= note: `-D unseparated-literal-suffix` implied by `-D warnings`
error: float type suffix should be separated by an underscore
- --> examples/literals.rs:25:17
+ --> literals.rs:25:17
|
25 | let fail7 = 1.5f32;
| ^^^^^^
= note: `-D unseparated-literal-suffix` implied by `-D warnings`
error: this is a decimal constant
- --> examples/literals.rs:29:17
+ --> literals.rs:29:17
|
29 | let fail8 = 0123;
| ^^^^
error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
- --> examples/map_clone.rs:12:5
+ --> map_clone.rs:12:5
|
12 | x.iter().map(|y| y.clone());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
x.iter().cloned()
error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
- --> examples/map_clone.rs:14:5
+ --> map_clone.rs:14:5
|
14 | x.iter().map(|&y| y);
| ^^^^^^^^^^^^^^^^^^^^
x.iter().cloned()
error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
- --> examples/map_clone.rs:16:5
+ --> map_clone.rs:16:5
|
16 | x.iter().map(|y| *y);
| ^^^^^^^^^^^^^^^^^^^^
x.iter().cloned()
error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
- --> examples/map_clone.rs:18:5
+ --> map_clone.rs:18:5
|
18 | x.iter().map(|y| { y.clone() });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x.iter().cloned()
error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
- --> examples/map_clone.rs:20:5
+ --> map_clone.rs:20:5
|
20 | x.iter().map(|&y| { y });
| ^^^^^^^^^^^^^^^^^^^^^^^^
x.iter().cloned()
error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
- --> examples/map_clone.rs:22:5
+ --> map_clone.rs:22:5
|
22 | x.iter().map(|y| { *y });
| ^^^^^^^^^^^^^^^^^^^^^^^^
x.iter().cloned()
error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
- --> examples/map_clone.rs:24:5
+ --> map_clone.rs:24:5
|
24 | x.iter().map(Clone::clone);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
x.iter().cloned()
error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
- --> examples/map_clone.rs:30:5
+ --> map_clone.rs:30:5
|
30 | x.as_ref().map(|y| y.clone());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x.as_ref().cloned()
error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
- --> examples/map_clone.rs:32:5
+ --> map_clone.rs:32:5
|
32 | x.as_ref().map(|&y| y);
| ^^^^^^^^^^^^^^^^^^^^^^
x.as_ref().cloned()
error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
- --> examples/map_clone.rs:34:5
+ --> map_clone.rs:34:5
|
34 | x.as_ref().map(|y| *y);
| ^^^^^^^^^^^^^^^^^^^^^^
x.as_ref().cloned()
error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
- --> examples/map_clone.rs:90:35
+ --> map_clone.rs:90:35
|
90 | let _: Option<UnusualDeref> = x.as_ref().map(|y| *y);
| ^^^^^^^^^^^^^^^^^^^^^^
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
- --> examples/matches.rs:26:5
+ --> matches.rs:26:5
|
26 | / match ExprNode::Butterflies {
27 | | ExprNode::ExprAddrOf => Some(&NODE),
= note: `-D single-match-else` implied by `-D warnings`
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
- --> examples/matches.rs:35:5
+ --> matches.rs:35:5
|
35 | / match x {
36 | | Some(y) => { println!("{:?}", y); }
= note: `-D single-match` implied by `-D warnings`
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
- --> examples/matches.rs:41:5
+ --> matches.rs:41:5
|
41 | / match z {
42 | | (2...3, 7...9) => dummy(),
= note: `-D single-match` implied by `-D warnings`
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
- --> examples/matches.rs:63:5
+ --> matches.rs:63:5
|
63 | / match x {
64 | | Some(y) => dummy(),
= note: `-D single-match` implied by `-D warnings`
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
- --> examples/matches.rs:68:5
+ --> matches.rs:68:5
|
68 | / match y {
69 | | Ok(y) => dummy(),
= note: `-D single-match` implied by `-D warnings`
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
- --> examples/matches.rs:75:5
+ --> matches.rs:75:5
|
75 | / match c {
76 | | Cow::Borrowed(..) => dummy(),
= note: `-D single-match` implied by `-D warnings`
error: you seem to be trying to match on a boolean expression
- --> examples/matches.rs:96:5
+ --> matches.rs:96:5
|
96 | / match test {
97 | | true => 0,
= note: `-D match-bool` implied by `-D warnings`
error: you seem to be trying to match on a boolean expression
- --> examples/matches.rs:102:5
+ --> matches.rs:102:5
|
102 | / match option == 1 {
103 | | true => 1,
= note: `-D match-bool` implied by `-D warnings`
error: you seem to be trying to match on a boolean expression
- --> examples/matches.rs:107:5
+ --> matches.rs:107:5
|
107 | / match test {
108 | | true => (),
= note: `-D match-bool` implied by `-D warnings`
error: you seem to be trying to match on a boolean expression
- --> examples/matches.rs:112:5
+ --> matches.rs:112:5
|
112 | / match test {
113 | | false => { println!("Noooo!"); }
= note: `-D match-bool` implied by `-D warnings`
error: you seem to be trying to match on a boolean expression
- --> examples/matches.rs:117:5
+ --> matches.rs:117:5
|
117 | / match test && test {
118 | | false => { println!("Noooo!"); }
= note: `-D match-bool` implied by `-D warnings`
error: equal expressions as operands to `&&`
- --> examples/matches.rs:117:11
+ --> matches.rs:117:11
|
117 | match test && test {
| ^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: you seem to be trying to match on a boolean expression
- --> examples/matches.rs:122:5
+ --> matches.rs:122:5
|
122 | / match test {
123 | | false => { println!("Noooo!"); }
= note: `-D match-bool` implied by `-D warnings`
error: you don't need to add `&` to all patterns
- --> examples/matches.rs:138:9
+ --> matches.rs:138:9
|
138 | / match v {
139 | | &Some(v) => println!("{:?}", v),
| match *v { .. }
error: you don't need to add `&` to all patterns
- --> examples/matches.rs:148:5
+ --> matches.rs:148:5
|
148 | / match tup {
149 | | &(v, 1) => println!("{}", v),
| match *tup { .. }
error: you don't need to add `&` to both the expression and the patterns
- --> examples/matches.rs:154:5
+ --> matches.rs:154:5
|
154 | / match &w {
155 | | &Some(v) => println!("{:?}", v),
= note: `-D match-ref-pats` implied by `-D warnings`
error: you don't need to add `&` to all patterns
- --> examples/matches.rs:165:5
+ --> matches.rs:165:5
|
165 | / if let &None = a {
166 | | println!("none");
| if let .. = *a { .. }
error: you don't need to add `&` to both the expression and the patterns
- --> examples/matches.rs:170:5
+ --> matches.rs:170:5
|
170 | / if let &None = &b {
171 | | println!("none");
= note: `-D match-ref-pats` implied by `-D warnings`
error: some ranges overlap
- --> examples/matches.rs:179:9
+ --> matches.rs:179:9
|
179 | 0 ... 10 => println!("0 ... 10"),
| ^^^^^^^^
|
= note: `-D match-overlapping-arm` implied by `-D warnings`
note: overlaps with this
- --> examples/matches.rs:180:9
+ --> matches.rs:180:9
|
180 | 0 ... 11 => println!("0 ... 11"),
| ^^^^^^^^
error: some ranges overlap
- --> examples/matches.rs:185:9
+ --> matches.rs:185:9
|
185 | 0 ... 5 => println!("0 ... 5"),
| ^^^^^^^
|
= note: `-D match-overlapping-arm` implied by `-D warnings`
note: overlaps with this
- --> examples/matches.rs:187:9
+ --> matches.rs:187:9
|
187 | FOO ... 11 => println!("0 ... 11"),
| ^^^^^^^^^^
error: some ranges overlap
- --> examples/matches.rs:193:9
+ --> matches.rs:193:9
|
193 | 0 ... 5 => println!("0 ... 5"),
| ^^^^^^^
|
= note: `-D match-overlapping-arm` implied by `-D warnings`
note: overlaps with this
- --> examples/matches.rs:192:9
+ --> matches.rs:192:9
|
192 | 2 => println!("2"),
| ^
error: some ranges overlap
- --> examples/matches.rs:199:9
+ --> matches.rs:199:9
|
199 | 0 ... 2 => println!("0 ... 2"),
| ^^^^^^^
|
= note: `-D match-overlapping-arm` implied by `-D warnings`
note: overlaps with this
- --> examples/matches.rs:198:9
+ --> matches.rs:198:9
|
198 | 2 => println!("2"),
| ^
error: some ranges overlap
- --> examples/matches.rs:222:9
+ --> matches.rs:222:9
|
222 | 0 .. 11 => println!("0 .. 11"),
| ^^^^^^^
|
= note: `-D match-overlapping-arm` implied by `-D warnings`
note: overlaps with this
- --> examples/matches.rs:223:9
+ --> matches.rs:223:9
|
223 | 0 ... 11 => println!("0 ... 11"),
| ^^^^^^^^
error: Err(_) will match all errors, maybe not a good idea
- --> examples/matches.rs:240:9
+ --> matches.rs:240:9
|
240 | Err(_) => panic!("err")
| ^^^^^^
= note: to remove this warning, match each error seperately or use unreachable macro
error: Err(_) will match all errors, maybe not a good idea
- --> examples/matches.rs:246:9
+ --> matches.rs:246:9
|
246 | Err(_) => {panic!()}
| ^^^^^^
= note: to remove this warning, match each error seperately or use unreachable macro
error: Err(_) will match all errors, maybe not a good idea
- --> examples/matches.rs:252:9
+ --> matches.rs:252:9
|
252 | Err(_) => {panic!();}
| ^^^^^^
error: usage of mem::forget on Drop type
- --> examples/mem_forget.rs:18:5
+ --> mem_forget.rs:18:5
|
18 | memstuff::forget(six);
| ^^^^^^^^^^^^^^^^^^^^^
= note: `-D mem-forget` implied by `-D warnings`
error: usage of mem::forget on Drop type
- --> examples/mem_forget.rs:21:5
+ --> mem_forget.rs:21:5
|
21 | std::mem::forget(seven);
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D mem-forget` implied by `-D warnings`
error: usage of mem::forget on Drop type
- --> examples/mem_forget.rs:24:5
+ --> mem_forget.rs:24:5
|
24 | forgetSomething(eight);
| ^^^^^^^^^^^^^^^^^^^^^^
error: defining a method called `add` on this type; consider implementing the `std::ops::Add` trait or choosing a less ambiguous name
- --> examples/methods.rs:18:5
+ --> methods.rs:18:5
|
18 | fn add(self, other: T) -> T { self }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D should-implement-trait` implied by `-D warnings`
error: defining a method called `drop` on this type; consider implementing the `std::ops::Drop` trait or choosing a less ambiguous name
- --> examples/methods.rs:19:5
+ --> methods.rs:19:5
|
19 | fn drop(&mut self) { }
| ^^^^^^^^^^^^^^^^^^^^^^
= note: `-D should-implement-trait` implied by `-D warnings`
error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
- --> examples/methods.rs:26:17
+ --> methods.rs:26:17
|
26 | fn into_u16(&self) -> u16 { 0 }
| ^^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
- --> examples/methods.rs:28:21
+ --> methods.rs:28:21
|
28 | fn to_something(self) -> u32 { 0 }
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `new` usually take no self; consider choosing a less ambiguous name
- --> examples/methods.rs:30:12
+ --> methods.rs:30:12
|
30 | fn new(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `new` usually return `Self`
- --> examples/methods.rs:30:5
+ --> methods.rs:30:5
|
30 | fn new(self) {}
| ^^^^^^^^^^^^^^^
= note: `-D new-ret-no-self` implied by `-D warnings`
error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
- --> examples/methods.rs:97:13
+ --> methods.rs:97:13
|
97 | let _ = opt.map(|x| x + 1)
| _____________^
= note: replace `map(|x| x + 1).unwrap_or(0)` with `map_or(0, |x| x + 1)`
error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
- --> examples/methods.rs:101:13
+ --> methods.rs:101:13
|
101 | let _ = opt.map(|x| {
| _____________^
= note: `-D option-map-unwrap-or` implied by `-D warnings`
error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
- --> examples/methods.rs:105:13
+ --> methods.rs:105:13
|
105 | let _ = opt.map(|x| x + 1)
| _____________^
= note: `-D option-map-unwrap-or` implied by `-D warnings`
error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
- --> examples/methods.rs:114:13
+ --> methods.rs:114:13
|
114 | let _ = opt.map(|x| x + 1)
| _____________^
= note: replace `map(|x| x + 1).unwrap_or_else(|| 0)` with `map_or_else(|| 0, |x| x + 1)`
error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
- --> examples/methods.rs:118:13
+ --> methods.rs:118:13
|
118 | let _ = opt.map(|x| {
| _____________^
= note: `-D option-map-unwrap-or-else` implied by `-D warnings`
error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
- --> examples/methods.rs:122:13
+ --> methods.rs:122:13
|
122 | let _ = opt.map(|x| x + 1)
| _____________^
= note: `-D option-map-unwrap-or-else` implied by `-D warnings`
error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
- --> examples/methods.rs:194:13
+ --> methods.rs:194:13
|
194 | let _ = v.iter().filter(|&x| *x < 0).next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
- --> examples/methods.rs:197:13
+ --> methods.rs:197:13
|
197 | let _ = v.iter().filter(|&x| {
| _____________^
= note: `-D filter-next` implied by `-D warnings`
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
- --> examples/methods.rs:212:13
+ --> methods.rs:212:13
|
212 | let _ = v.iter().find(|&x| *x < 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: replace `find(|&x| *x < 0).is_some()` with `any(|&x| *x < 0)`
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
- --> examples/methods.rs:215:13
+ --> methods.rs:215:13
|
215 | let _ = v.iter().find(|&x| {
| _____________^
= note: `-D search-is-some` implied by `-D warnings`
error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
- --> examples/methods.rs:221:13
+ --> methods.rs:221:13
|
221 | let _ = v.iter().position(|&x| x < 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: replace `position(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
- --> examples/methods.rs:224:13
+ --> methods.rs:224:13
|
224 | let _ = v.iter().position(|&x| {
| _____________^
= note: `-D search-is-some` implied by `-D warnings`
error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
- --> examples/methods.rs:230:13
+ --> methods.rs:230:13
|
230 | let _ = v.iter().rposition(|&x| x < 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: replace `rposition(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
- --> examples/methods.rs:233:13
+ --> methods.rs:233:13
|
233 | let _ = v.iter().rposition(|&x| {
| _____________^
= note: `-D search-is-some` implied by `-D warnings`
error: use of `unwrap_or` followed by a function call
- --> examples/methods.rs:268:5
+ --> methods.rs:268:5
|
268 | with_constructor.unwrap_or(make());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_constructor.unwrap_or_else(make)`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `unwrap_or` followed by a call to `new`
- --> examples/methods.rs:271:5
+ --> methods.rs:271:5
|
271 | with_new.unwrap_or(Vec::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_new.unwrap_or_default()`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `unwrap_or` followed by a function call
- --> examples/methods.rs:274:5
+ --> methods.rs:274:5
|
274 | with_const_args.unwrap_or(Vec::with_capacity(12));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_const_args.unwrap_or_else(|| Vec::with_capacity(12))`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `unwrap_or` followed by a function call
- --> examples/methods.rs:277:5
+ --> methods.rs:277:5
|
277 | with_err.unwrap_or(make());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_err.unwrap_or_else(|_| make())`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `unwrap_or` followed by a function call
- --> examples/methods.rs:280:5
+ --> methods.rs:280:5
|
280 | with_err_args.unwrap_or(Vec::with_capacity(12));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_err_args.unwrap_or_else(|_| Vec::with_capacity(12))`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `unwrap_or` followed by a call to `default`
- --> examples/methods.rs:283:5
+ --> methods.rs:283:5
|
283 | with_default_trait.unwrap_or(Default::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_default_trait.unwrap_or_default()`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `unwrap_or` followed by a call to `default`
- --> examples/methods.rs:286:5
+ --> methods.rs:286:5
|
286 | with_default_type.unwrap_or(u64::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_default_type.unwrap_or_default()`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `unwrap_or` followed by a function call
- --> examples/methods.rs:289:5
+ --> methods.rs:289:5
|
289 | with_vec.unwrap_or(vec![]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `with_vec.unwrap_or_else(|| < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ))`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `unwrap_or` followed by a function call
- --> examples/methods.rs:294:5
+ --> methods.rs:294:5
|
294 | without_default.unwrap_or(Foo::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `without_default.unwrap_or_else(Foo::new)`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `or_insert` followed by a function call
- --> examples/methods.rs:297:5
+ --> methods.rs:297:5
|
297 | map.entry(42).or_insert(String::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `map.entry(42).or_insert_with(String::new)`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `or_insert` followed by a function call
- --> examples/methods.rs:300:5
+ --> methods.rs:300:5
|
300 | btree.entry(42).or_insert(String::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `btree.entry(42).or_insert_with(String::new)`
= note: `-D or-fun-call` implied by `-D warnings`
error: use of `unwrap_or` followed by a function call
- --> examples/methods.rs:303:13
+ --> methods.rs:303:13
|
303 | let _ = stringy.unwrap_or("".to_owned());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `stringy.unwrap_or_else(|| "".to_owned())`
= note: `-D or-fun-call` implied by `-D warnings`
error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
- --> examples/methods.rs:314:23
+ --> methods.rs:314:23
|
314 | let bad_vec = some_vec.iter().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-nth` implied by `-D warnings`
error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
- --> examples/methods.rs:315:26
+ --> methods.rs:315:26
|
315 | let bad_slice = &some_vec[..].iter().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-nth` implied by `-D warnings`
error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
- --> examples/methods.rs:316:31
+ --> methods.rs:316:31
|
316 | let bad_boxed_slice = boxed_slice.iter().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-nth` implied by `-D warnings`
error: called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable
- --> examples/methods.rs:317:29
+ --> methods.rs:317:29
|
317 | let bad_vec_deque = some_vec_deque.iter().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-nth` implied by `-D warnings`
error: called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable
- --> examples/methods.rs:322:23
+ --> methods.rs:322:23
|
322 | let bad_vec = some_vec.iter_mut().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-nth` implied by `-D warnings`
error: called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable
- --> examples/methods.rs:325:26
+ --> methods.rs:325:26
|
325 | let bad_slice = &some_vec[..].iter_mut().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-nth` implied by `-D warnings`
error: called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable
- --> examples/methods.rs:328:29
+ --> methods.rs:328:29
|
328 | let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-nth` implied by `-D warnings`
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
- --> examples/methods.rs:340:13
+ --> methods.rs:340:13
|
340 | let _ = some_vec.iter().skip(42).next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-skip-next` implied by `-D warnings`
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
- --> examples/methods.rs:341:13
+ --> methods.rs:341:13
|
341 | let _ = some_vec.iter().cycle().skip(42).next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-skip-next` implied by `-D warnings`
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
- --> examples/methods.rs:342:13
+ --> methods.rs:342:13
|
342 | let _ = (1..10).skip(10).next();
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-skip-next` implied by `-D warnings`
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
- --> examples/methods.rs:343:14
+ --> methods.rs:343:14
|
343 | let _ = &some_vec[..].iter().skip(3).next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D iter-skip-next` implied by `-D warnings`
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
- --> examples/methods.rs:369:17
+ --> methods.rs:369:17
|
369 | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&boxed_slice[1]`
= note: `-D get-unwrap` implied by `-D warnings`
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
- --> examples/methods.rs:370:17
+ --> methods.rs:370:17
|
370 | let _ = some_slice.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_slice[0]`
= note: `-D get-unwrap` implied by `-D warnings`
error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
- --> examples/methods.rs:371:17
+ --> methods.rs:371:17
|
371 | let _ = some_vec.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_vec[0]`
= note: `-D get-unwrap` implied by `-D warnings`
error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
- --> examples/methods.rs:372:17
+ --> methods.rs:372:17
|
372 | let _ = some_vecdeque.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_vecdeque[0]`
= note: `-D get-unwrap` implied by `-D warnings`
error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
- --> examples/methods.rs:373:17
+ --> methods.rs:373:17
|
373 | let _ = some_hashmap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_hashmap[&1]`
= note: `-D get-unwrap` implied by `-D warnings`
error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
- --> examples/methods.rs:374:17
+ --> methods.rs:374:17
|
374 | let _ = some_btreemap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&some_btreemap[&1]`
= note: `-D get-unwrap` implied by `-D warnings`
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
- --> examples/methods.rs:379:10
+ --> methods.rs:379:10
|
379 | *boxed_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&mut boxed_slice[0]`
= note: `-D get-unwrap` implied by `-D warnings`
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
- --> examples/methods.rs:380:10
+ --> methods.rs:380:10
|
380 | *some_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&mut some_slice[0]`
= note: `-D get-unwrap` implied by `-D warnings`
error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
- --> examples/methods.rs:381:10
+ --> methods.rs:381:10
|
381 | *some_vec.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&mut some_vec[0]`
= note: `-D get-unwrap` implied by `-D warnings`
error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
- --> examples/methods.rs:382:10
+ --> methods.rs:382:10
|
382 | *some_vecdeque.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `&mut some_vecdeque[0]`
= note: `-D get-unwrap` implied by `-D warnings`
error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
- --> examples/methods.rs:396:13
+ --> methods.rs:396:13
|
396 | let _ = opt.unwrap();
| ^^^^^^^^^^^^
= note: `-D option-unwrap-used` implied by `-D warnings`
error: used unwrap() on a Result value. If you don't want to handle the Err case gracefully, consider using expect() to provide a better panic message
- --> examples/methods.rs:399:13
+ --> methods.rs:399:13
|
399 | let _ = res.unwrap();
| ^^^^^^^^^^^^
= note: `-D result-unwrap-used` implied by `-D warnings`
error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
- --> examples/methods.rs:401:5
+ --> methods.rs:401:5
|
401 | res.ok().expect("disaster!");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D ok-expect` implied by `-D warnings`
error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
- --> examples/methods.rs:407:5
+ --> methods.rs:407:5
|
407 | res3.ok().expect("whoof");
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D ok-expect` implied by `-D warnings`
error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
- --> examples/methods.rs:409:5
+ --> methods.rs:409:5
|
409 | res4.ok().expect("argh");
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D ok-expect` implied by `-D warnings`
error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
- --> examples/methods.rs:411:5
+ --> methods.rs:411:5
|
411 | res5.ok().expect("oops");
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D ok-expect` implied by `-D warnings`
error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
- --> examples/methods.rs:413:5
+ --> methods.rs:413:5
|
413 | res6.ok().expect("meh");
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D ok-expect` implied by `-D warnings`
error: you should use the `starts_with` method
- --> examples/methods.rs:425:5
+ --> methods.rs:425:5
|
425 | "".chars().next() == Some(' ');
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this `"".starts_with(' ')`
= note: `-D chars-next-cmp` implied by `-D warnings`
error: you should use the `starts_with` method
- --> examples/methods.rs:426:5
+ --> methods.rs:426:5
|
426 | Some(' ') != "".chars().next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this `!"".starts_with(' ')`
= note: `-D chars-next-cmp` implied by `-D warnings`
error: calling `.extend(_.chars())`
- --> examples/methods.rs:435:5
+ --> methods.rs:435:5
|
435 | s.extend(abc.chars());
| ^^^^^^^^^^^^^^^^^^^^^ help: try this `s.push_str(abc)`
= note: `-D string-extend-chars` implied by `-D warnings`
error: calling `.extend(_.chars())`
- --> examples/methods.rs:438:5
+ --> methods.rs:438:5
|
438 | s.extend("abc".chars());
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try this `s.push_str("abc")`
= note: `-D string-extend-chars` implied by `-D warnings`
error: calling `.extend(_.chars())`
- --> examples/methods.rs:441:5
+ --> methods.rs:441:5
|
441 | s.extend(def.chars());
| ^^^^^^^^^^^^^^^^^^^^^ help: try this `s.push_str(&def)`
= note: `-D string-extend-chars` implied by `-D warnings`
error: using `clone` on a `Copy` type
- --> examples/methods.rs:452:5
+ --> methods.rs:452:5
|
452 | 42.clone();
| ^^^^^^^^^^ help: try removing the `clone` call `42`
= note: `-D clone-on-copy` implied by `-D warnings`
error: using `clone` on a `Copy` type
- --> examples/methods.rs:456:5
+ --> methods.rs:456:5
|
456 | (&42).clone();
| ^^^^^^^^^^^^^ help: try dereferencing it `*(&42)`
= note: `-D clone-on-copy` implied by `-D warnings`
error: using `clone` on a `Copy` type
- --> examples/methods.rs:460:5
+ --> methods.rs:460:5
|
460 | t.clone();
| ^^^^^^^^^ help: try removing the `clone` call `t`
= note: `-D clone-on-copy` implied by `-D warnings`
error: using `clone` on a `Copy` type
- --> examples/methods.rs:462:5
+ --> methods.rs:462:5
|
462 | Some(t).clone();
| ^^^^^^^^^^^^^^^ help: try removing the `clone` call `Some(t)`
= note: `-D clone-on-copy` implied by `-D warnings`
error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
- --> examples/methods.rs:468:22
+ --> methods.rs:468:22
|
468 | let z: &Vec<_> = y.clone();
| ^^^^^^^^^ help: try dereferencing it `(*y).clone()`
= note: `-D clone-double-ref` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:475:13
+ --> methods.rs:475:13
|
475 | x.split("x");
| --------^^^- help: try using a char instead: `x.split('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:492:16
+ --> methods.rs:492:16
|
492 | x.contains("x");
| -----------^^^- help: try using a char instead: `x.contains('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:493:19
+ --> methods.rs:493:19
|
493 | x.starts_with("x");
| --------------^^^- help: try using a char instead: `x.starts_with('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:494:17
+ --> methods.rs:494:17
|
494 | x.ends_with("x");
| ------------^^^- help: try using a char instead: `x.ends_with('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:495:12
+ --> methods.rs:495:12
|
495 | x.find("x");
| -------^^^- help: try using a char instead: `x.find('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:496:13
+ --> methods.rs:496:13
|
496 | x.rfind("x");
| --------^^^- help: try using a char instead: `x.rfind('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:497:14
+ --> methods.rs:497:14
|
497 | x.rsplit("x");
| ---------^^^- help: try using a char instead: `x.rsplit('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:498:24
+ --> methods.rs:498:24
|
498 | x.split_terminator("x");
| -------------------^^^- help: try using a char instead: `x.split_terminator('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:499:25
+ --> methods.rs:499:25
|
499 | x.rsplit_terminator("x");
| --------------------^^^- help: try using a char instead: `x.rsplit_terminator('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:500:17
+ --> methods.rs:500:17
|
500 | x.splitn(0, "x");
| ------------^^^- help: try using a char instead: `x.splitn(0, 'x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:501:18
+ --> methods.rs:501:18
|
501 | x.rsplitn(0, "x");
| -------------^^^- help: try using a char instead: `x.rsplitn(0, 'x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:502:15
+ --> methods.rs:502:15
|
502 | x.matches("x");
| ----------^^^- help: try using a char instead: `x.matches('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:503:16
+ --> methods.rs:503:16
|
503 | x.rmatches("x");
| -----------^^^- help: try using a char instead: `x.rmatches('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:504:21
+ --> methods.rs:504:21
|
504 | x.match_indices("x");
| ----------------^^^- help: try using a char instead: `x.match_indices('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:505:22
+ --> methods.rs:505:22
|
505 | x.rmatch_indices("x");
| -----------------^^^- help: try using a char instead: `x.rmatch_indices('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:506:25
+ --> methods.rs:506:25
|
506 | x.trim_left_matches("x");
| --------------------^^^- help: try using a char instead: `x.trim_left_matches('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: single-character string constant used as pattern
- --> examples/methods.rs:507:26
+ --> methods.rs:507:26
|
507 | x.trim_right_matches("x");
| ---------------------^^^- help: try using a char instead: `x.trim_right_matches('x')`
= note: `-D single-char-pattern` implied by `-D warnings`
error: you are getting the inner pointer of a temporary `CString`
- --> examples/methods.rs:517:5
+ --> methods.rs:517:5
|
517 | CString::new("foo").unwrap().as_ptr();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D temporary-cstring-as-ptr` implied by `-D warnings`
= note: that pointer will be invalid outside this expression
help: assign the `CString` to a variable to extend its lifetime
- --> examples/methods.rs:517:5
+ --> methods.rs:517:5
|
517 | CString::new("foo").unwrap().as_ptr();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: called `cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
- --> examples/methods.rs:522:27
+ --> methods.rs:522:27
|
522 | let v2 : Vec<isize> = v.iter().cloned().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this min/max combination leads to constant result
- --> examples/min_max.rs:15:5
+ --> min_max.rs:15:5
|
15 | min(1, max(3, x));
| ^^^^^^^^^^^^^^^^^
= note: `-D min-max` implied by `-D warnings`
error: this min/max combination leads to constant result
- --> examples/min_max.rs:16:5
+ --> min_max.rs:16:5
|
16 | min(max(3, x), 1);
| ^^^^^^^^^^^^^^^^^
= note: `-D min-max` implied by `-D warnings`
error: this min/max combination leads to constant result
- --> examples/min_max.rs:17:5
+ --> min_max.rs:17:5
|
17 | max(min(x, 1), 3);
| ^^^^^^^^^^^^^^^^^
= note: `-D min-max` implied by `-D warnings`
error: this min/max combination leads to constant result
- --> examples/min_max.rs:18:5
+ --> min_max.rs:18:5
|
18 | max(3, min(x, 1));
| ^^^^^^^^^^^^^^^^^
= note: `-D min-max` implied by `-D warnings`
error: this min/max combination leads to constant result
- --> examples/min_max.rs:20:5
+ --> min_max.rs:20:5
|
20 | my_max(3, my_min(x, 1));
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D min-max` implied by `-D warnings`
error: this min/max combination leads to constant result
- --> examples/min_max.rs:29:5
+ --> min_max.rs:29:5
|
29 | min("Apple", max("Zoo", s));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D min-max` implied by `-D warnings`
error: this min/max combination leads to constant result
- --> examples/min_max.rs:30:5
+ --> min_max.rs:30:5
|
30 | max(min(s, "Apple"), "Zoo");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a type alias
- --> examples/missing-doc.rs:26:1
+ --> missing-doc.rs:26:1
|
26 | type Typedef = String;
| ^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a type alias
- --> examples/missing-doc.rs:27:1
+ --> missing-doc.rs:27:1
|
27 | pub type PubTypedef = String;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a struct
- --> examples/missing-doc.rs:29:1
+ --> missing-doc.rs:29:1
|
29 | / struct Foo {
30 | | a: isize,
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a struct field
- --> examples/missing-doc.rs:30:5
+ --> missing-doc.rs:30:5
|
30 | a: isize,
| ^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a struct field
- --> examples/missing-doc.rs:31:5
+ --> missing-doc.rs:31:5
|
31 | b: isize,
| ^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a struct
- --> examples/missing-doc.rs:34:1
+ --> missing-doc.rs:34:1
|
34 | / pub struct PubFoo {
35 | | pub a: isize,
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a struct field
- --> examples/missing-doc.rs:35:5
+ --> missing-doc.rs:35:5
|
35 | pub a: isize,
| ^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a struct field
- --> examples/missing-doc.rs:36:5
+ --> missing-doc.rs:36:5
|
36 | b: isize,
| ^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a module
- --> examples/missing-doc.rs:45:1
+ --> missing-doc.rs:45:1
|
45 | mod module_no_dox {}
| ^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a module
- --> examples/missing-doc.rs:46:1
+ --> missing-doc.rs:46:1
|
46 | pub mod pub_module_no_dox {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a function
- --> examples/missing-doc.rs:50:1
+ --> missing-doc.rs:50:1
|
50 | pub fn foo2() {}
| ^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a function
- --> examples/missing-doc.rs:51:1
+ --> missing-doc.rs:51:1
|
51 | fn foo3() {}
| ^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a trait
- --> examples/missing-doc.rs:68:1
+ --> missing-doc.rs:68:1
|
68 | / pub trait C {
69 | | fn foo(&self);
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a trait method
- --> examples/missing-doc.rs:69:5
+ --> missing-doc.rs:69:5
|
69 | fn foo(&self);
| ^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a trait method
- --> examples/missing-doc.rs:70:5
+ --> missing-doc.rs:70:5
|
70 | fn foo_with_impl(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for an associated type
- --> examples/missing-doc.rs:80:5
+ --> missing-doc.rs:80:5
|
80 | type AssociatedType;
| ^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for an associated type
- --> examples/missing-doc.rs:81:5
+ --> missing-doc.rs:81:5
|
81 | type AssociatedTypeDef = Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a method
- --> examples/missing-doc.rs:92:5
+ --> missing-doc.rs:92:5
|
92 | pub fn foo() {}
| ^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a method
- --> examples/missing-doc.rs:93:5
+ --> missing-doc.rs:93:5
|
93 | fn bar() {}
| ^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a method
- --> examples/missing-doc.rs:97:5
+ --> missing-doc.rs:97:5
|
97 | pub fn foo() {}
| ^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a method
- --> examples/missing-doc.rs:100:5
+ --> missing-doc.rs:100:5
|
100 | fn foo2() {}
| ^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for an enum
- --> examples/missing-doc.rs:126:1
+ --> missing-doc.rs:126:1
|
126 | / enum Baz {
127 | | BazA {
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a variant
- --> examples/missing-doc.rs:127:5
+ --> missing-doc.rs:127:5
|
127 | / BazA {
128 | | a: isize,
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a struct field
- --> examples/missing-doc.rs:128:9
+ --> missing-doc.rs:128:9
|
128 | a: isize,
| ^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a struct field
- --> examples/missing-doc.rs:129:9
+ --> missing-doc.rs:129:9
|
129 | b: isize
| ^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a variant
- --> examples/missing-doc.rs:131:5
+ --> missing-doc.rs:131:5
|
131 | BarB
| ^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for an enum
- --> examples/missing-doc.rs:134:1
+ --> missing-doc.rs:134:1
|
134 | / pub enum PubBaz {
135 | | PubBazA {
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a variant
- --> examples/missing-doc.rs:135:5
+ --> missing-doc.rs:135:5
|
135 | / PubBazA {
136 | | a: isize,
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a struct field
- --> examples/missing-doc.rs:136:9
+ --> missing-doc.rs:136:9
|
136 | a: isize,
| ^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a constant
- --> examples/missing-doc.rs:160:1
+ --> missing-doc.rs:160:1
|
160 | const FOO: u32 = 0;
| ^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a constant
- --> examples/missing-doc.rs:167:1
+ --> missing-doc.rs:167:1
|
167 | pub const FOO4: u32 = 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a static
- --> examples/missing-doc.rs:170:1
+ --> missing-doc.rs:170:1
|
170 | static BAR: u32 = 0;
| ^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a static
- --> examples/missing-doc.rs:177:1
+ --> missing-doc.rs:177:1
|
177 | pub static BAR4: u32 = 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a module
- --> examples/missing-doc.rs:180:1
+ --> missing-doc.rs:180:1
|
180 | / mod internal_impl {
181 | | /// dox
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a function
- --> examples/missing-doc.rs:183:5
+ --> missing-doc.rs:183:5
|
183 | pub fn undocumented1() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a function
- --> examples/missing-doc.rs:184:5
+ --> missing-doc.rs:184:5
|
184 | pub fn undocumented2() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a function
- --> examples/missing-doc.rs:185:5
+ --> missing-doc.rs:185:5
|
185 | fn undocumented3() {}
| ^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a function
- --> examples/missing-doc.rs:190:9
+ --> missing-doc.rs:190:9
|
190 | pub fn also_undocumented1() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a function
- --> examples/missing-doc.rs:191:9
+ --> missing-doc.rs:191:9
|
191 | fn also_undocumented2() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D missing-docs-in-private-items` implied by `-D warnings`
error: missing documentation for a function
- --> examples/missing-doc.rs:202:1
+ --> missing-doc.rs:202:1
|
202 | fn main() {}
| ^^^^^^^^^^^^
error: module has the same name as its containing module
- --> examples/module_inception.rs:7:9
+ --> module_inception.rs:7:9
|
7 | / mod bar {
8 | | mod foo {}
= note: `-D module-inception` implied by `-D warnings`
error: module has the same name as its containing module
- --> examples/module_inception.rs:12:5
+ --> module_inception.rs:12:5
|
12 | / mod foo {
13 | | mod bar {}
error: any number modulo 1 will be 0
- --> examples/modulo_one.rs:7:5
+ --> modulo_one.rs:7:5
|
7 | 10 % 1;
| ^^^^^^
error: mutable borrow from immutable input(s)
- --> examples/mut_from_ref.rs:9:39
+ --> mut_from_ref.rs:9:39
|
9 | fn this_wont_hurt_a_bit(&self) -> &mut Foo {
| ^^^^^^^^
|
= note: `-D mut-from-ref` implied by `-D warnings`
note: immutable borrow here
- --> examples/mut_from_ref.rs:9:29
+ --> mut_from_ref.rs:9:29
|
9 | fn this_wont_hurt_a_bit(&self) -> &mut Foo {
| ^^^^^
error: mutable borrow from immutable input(s)
- --> examples/mut_from_ref.rs:15:25
+ --> mut_from_ref.rs:15:25
|
15 | fn ouch(x: &Foo) -> &mut Foo;
| ^^^^^^^^
|
= note: `-D mut-from-ref` implied by `-D warnings`
note: immutable borrow here
- --> examples/mut_from_ref.rs:15:16
+ --> mut_from_ref.rs:15:16
|
15 | fn ouch(x: &Foo) -> &mut Foo;
| ^^^^
error: mutable borrow from immutable input(s)
- --> examples/mut_from_ref.rs:24:21
+ --> mut_from_ref.rs:24:21
|
24 | fn fail(x: &u32) -> &mut u16 {
| ^^^^^^^^
|
= note: `-D mut-from-ref` implied by `-D warnings`
note: immutable borrow here
- --> examples/mut_from_ref.rs:24:12
+ --> mut_from_ref.rs:24:12
|
24 | fn fail(x: &u32) -> &mut u16 {
| ^^^^
error: mutable borrow from immutable input(s)
- --> examples/mut_from_ref.rs:28:50
+ --> mut_from_ref.rs:28:50
|
28 | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
| ^^^^^^^^^^^
|
= note: `-D mut-from-ref` implied by `-D warnings`
note: immutable borrow here
- --> examples/mut_from_ref.rs:28:25
+ --> mut_from_ref.rs:28:25
|
28 | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
| ^^^^^^^
error: mutable borrow from immutable input(s)
- --> examples/mut_from_ref.rs:32:67
+ --> mut_from_ref.rs:32:67
|
32 | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
| ^^^^^^^^^^^
|
= note: `-D mut-from-ref` implied by `-D warnings`
note: immutable borrow here
- --> examples/mut_from_ref.rs:32:27
+ --> mut_from_ref.rs:32:27
|
32 | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
| ^^^^^^^ ^^^^^^^
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:10:12
+ --> mut_mut.rs:10:12
|
10 | fn fun(x : &mut &mut u32) -> bool {
| ^^^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:24:17
+ --> mut_mut.rs:24:17
|
24 | let mut x = &mut &mut 1u32;
| ^^^^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:19:20
+ --> mut_mut.rs:19:20
|
19 | ($p:expr) => { &mut $p }
| ^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: this expression mutably borrows a mutable reference. Consider reborrowing
- --> examples/mut_mut.rs:26:21
+ --> mut_mut.rs:26:21
|
26 | let mut y = &mut x;
| ^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:30:17
+ --> mut_mut.rs:30:17
|
30 | let y : &mut &mut u32 = &mut &mut 2;
| ^^^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:30:33
+ --> mut_mut.rs:30:33
|
30 | let y : &mut &mut u32 = &mut &mut 2;
| ^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:30:17
+ --> mut_mut.rs:30:17
|
30 | let y : &mut &mut u32 = &mut &mut 2;
| ^^^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:35:17
+ --> mut_mut.rs:35:17
|
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:35:22
+ --> mut_mut.rs:35:22
|
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:35:38
+ --> mut_mut.rs:35:38
|
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:35:17
+ --> mut_mut.rs:35:17
|
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:35:22
+ --> mut_mut.rs:35:22
|
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^
= note: `-D mut-mut` implied by `-D warnings`
error: generally you want to avoid `&mut &mut _` if possible
- --> examples/mut_mut.rs:35:22
+ --> mut_mut.rs:35:22
|
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^
error: The function/method "takes_an_immutable_reference" doesn't need a mutable reference
- --> examples/mut_reference.rs:22:34
+ --> mut_reference.rs:22:34
|
22 | takes_an_immutable_reference(&mut 42);
| ^^^^^^^
= note: `-D unnecessary-mut-passed` implied by `-D warnings`
error: The function/method "as_ptr" doesn't need a mutable reference
- --> examples/mut_reference.rs:24:12
+ --> mut_reference.rs:24:12
|
24 | as_ptr(&mut 42);
| ^^^^^^^
= note: `-D unnecessary-mut-passed` implied by `-D warnings`
error: The function/method "takes_an_immutable_reference" doesn't need a mutable reference
- --> examples/mut_reference.rs:28:44
+ --> mut_reference.rs:28:44
|
28 | my_struct.takes_an_immutable_reference(&mut 42);
| ^^^^^^^
error: Consider using an AtomicBool instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>.
- --> examples/mutex_atomic.rs:9:5
+ --> mutex_atomic.rs:9:5
|
9 | Mutex::new(true);
| ^^^^^^^^^^^^^^^^
= note: `-D mutex-atomic` implied by `-D warnings`
error: Consider using an AtomicUsize instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>.
- --> examples/mutex_atomic.rs:10:5
+ --> mutex_atomic.rs:10:5
|
10 | Mutex::new(5usize);
| ^^^^^^^^^^^^^^^^^^
= note: `-D mutex-atomic` implied by `-D warnings`
error: Consider using an AtomicIsize instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>.
- --> examples/mutex_atomic.rs:11:5
+ --> mutex_atomic.rs:11:5
|
11 | Mutex::new(9isize);
| ^^^^^^^^^^^^^^^^^^
= note: `-D mutex-atomic` implied by `-D warnings`
error: Consider using an AtomicPtr instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>.
- --> examples/mutex_atomic.rs:13:5
+ --> mutex_atomic.rs:13:5
|
13 | Mutex::new(&x as *const u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D mutex-atomic` implied by `-D warnings`
error: Consider using an AtomicPtr instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>.
- --> examples/mutex_atomic.rs:14:5
+ --> mutex_atomic.rs:14:5
|
14 | Mutex::new(&mut x as *mut u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D mutex-atomic` implied by `-D warnings`
error: Consider using an AtomicUsize instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>.
- --> examples/mutex_atomic.rs:15:5
+ --> mutex_atomic.rs:15:5
|
15 | Mutex::new(0u32);
| ^^^^^^^^^^^^^^^^
= note: `-D mutex-integer` implied by `-D warnings`
error: Consider using an AtomicIsize instead of a Mutex here. If you just want the locking behaviour and not the internal type, consider using Mutex<()>.
- --> examples/mutex_atomic.rs:16:5
+ --> mutex_atomic.rs:16:5
|
16 | Mutex::new(0i32);
| ^^^^^^^^^^^^^^^^
error: this if-then-else expression will always return true
- --> examples/needless_bool.rs:9:5
+ --> needless_bool.rs:9:5
|
9 | if x { true } else { true };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression will always return false
- --> examples/needless_bool.rs:10:5
+ --> needless_bool.rs:10:5
|
10 | if x { false } else { false };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression returns a bool literal
- --> examples/needless_bool.rs:11:5
+ --> needless_bool.rs:11:5
|
11 | if x { true } else { false };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `x`
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression returns a bool literal
- --> examples/needless_bool.rs:12:5
+ --> needless_bool.rs:12:5
|
12 | if x { false } else { true };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!x`
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression returns a bool literal
- --> examples/needless_bool.rs:13:5
+ --> needless_bool.rs:13:5
|
13 | if x && y { false } else { true };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!(x && y)`
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression will always return true
- --> examples/needless_bool.rs:25:5
+ --> needless_bool.rs:25:5
|
25 | if x { return true } else { return true };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression will always return false
- --> examples/needless_bool.rs:30:5
+ --> needless_bool.rs:30:5
|
30 | if x { return false } else { return false };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression returns a bool literal
- --> examples/needless_bool.rs:35:5
+ --> needless_bool.rs:35:5
|
35 | if x { return true } else { return false };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x`
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression returns a bool literal
- --> examples/needless_bool.rs:40:5
+ --> needless_bool.rs:40:5
|
40 | if x && y { return true } else { return false };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x && y`
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression returns a bool literal
- --> examples/needless_bool.rs:45:5
+ --> needless_bool.rs:45:5
|
45 | if x { return false } else { return true };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !x`
= note: `-D needless-bool` implied by `-D warnings`
error: this if-then-else expression returns a bool literal
- --> examples/needless_bool.rs:50:5
+ --> needless_bool.rs:50:5
|
50 | if x && y { return false } else { return true };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !(x && y)`
error: this expression borrows a reference that is immediately dereferenced by the compiler
- --> examples/needless_borrow.rs:13:15
+ --> needless_borrow.rs:13:15
|
13 | let c = x(&&a);
| ^^^
= note: `-D needless-borrow` implied by `-D warnings`
error: this pattern creates a reference to a reference
- --> examples/needless_borrow.rs:20:17
+ --> needless_borrow.rs:20:17
|
20 | if let Some(ref cake) = Some(&5) {}
| ^^^^^^^^
= note: `-D needless-borrow` implied by `-D warnings`
error: this expression borrows a reference that is immediately dereferenced by the compiler
- --> examples/needless_borrow.rs:27:15
+ --> needless_borrow.rs:27:15
|
27 | 46 => &&a,
| ^^^
= note: `-D needless-borrow` implied by `-D warnings`
error: this pattern creates a reference to a reference
- --> examples/needless_borrow.rs:50:31
+ --> needless_borrow.rs:50:31
|
50 | let _ = v.iter().filter(|&ref a| a.is_empty());
| ^^^^^
error: This else block is redundant.
- --> examples/needless_continue.rs:26:16
+ --> needless_continue.rs:26:16
|
26 | } else {
| ________________^
error: There is no need for an explicit `else` block for this `if` expression
- --> examples/needless_continue.rs:41:9
+ --> needless_continue.rs:41:9
|
41 | / if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
42 | | continue;
error: this argument is passed by value, but not consumed in the function body
- --> examples/needless_pass_by_value.rs:9:23
+ --> needless_pass_by_value.rs:9:23
|
9 | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
| ^^^^^^ help: consider changing the type to `&[T]`
= note: `-D needless-pass-by-value` implied by `-D warnings`
error: this argument is passed by value, but not consumed in the function body
- --> examples/needless_pass_by_value.rs:23:11
+ --> needless_pass_by_value.rs:23:11
|
23 | fn bar(x: String, y: Wrapper) {
| ^^^^^^ help: consider changing the type to `&str`
= note: `-D needless-pass-by-value` implied by `-D warnings`
error: this argument is passed by value, but not consumed in the function body
- --> examples/needless_pass_by_value.rs:23:22
+ --> needless_pass_by_value.rs:23:22
|
23 | fn bar(x: String, y: Wrapper) {
| ^^^^^^^ help: consider taking a reference instead `&Wrapper`
= note: `-D needless-pass-by-value` implied by `-D warnings`
error: this argument is passed by value, but not consumed in the function body
- --> examples/needless_pass_by_value.rs:29:63
+ --> needless_pass_by_value.rs:29:63
|
29 | fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: U) {
| ^ help: consider taking a reference instead `&U`
= note: `-D needless-pass-by-value` implied by `-D warnings`
error: this argument is passed by value, but not consumed in the function body
- --> examples/needless_pass_by_value.rs:40:18
+ --> needless_pass_by_value.rs:40:18
|
40 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
| ^^^^^^^^^^^^^^^^^^^^^^
| match *x {
error: this argument is passed by value, but not consumed in the function body
- --> examples/needless_pass_by_value.rs:53:24
+ --> needless_pass_by_value.rs:53:24
|
53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
| ^^^^^^^ help: consider taking a reference instead `&Wrapper`
= note: `-D needless-pass-by-value` implied by `-D warnings`
error: this argument is passed by value, but not consumed in the function body
- --> examples/needless_pass_by_value.rs:53:36
+ --> needless_pass_by_value.rs:53:36
|
53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
| ^^^^^^^
error: unneeded return statement
- --> examples/needless_return.rs:11:5
+ --> needless_return.rs:11:5
|
11 | return true;
| ^^^^^^^^^^^^ help: remove `return` as shown: `true`
= note: `-D needless-return` implied by `-D warnings`
error: unneeded return statement
- --> examples/needless_return.rs:15:5
+ --> needless_return.rs:15:5
|
15 | return true
| ^^^^^^^^^^^ help: remove `return` as shown: `true`
= note: `-D needless-return` implied by `-D warnings`
error: unneeded return statement
- --> examples/needless_return.rs:20:9
+ --> needless_return.rs:20:9
|
20 | return true;
| ^^^^^^^^^^^^ help: remove `return` as shown: `true`
= note: `-D needless-return` implied by `-D warnings`
error: unneeded return statement
- --> examples/needless_return.rs:22:9
+ --> needless_return.rs:22:9
|
22 | return false;
| ^^^^^^^^^^^^^ help: remove `return` as shown: `false`
= note: `-D needless-return` implied by `-D warnings`
error: unneeded return statement
- --> examples/needless_return.rs:28:17
+ --> needless_return.rs:28:17
|
28 | true => return false,
| ^^^^^^^^^^^^ help: remove `return` as shown: `false`
= note: `-D needless-return` implied by `-D warnings`
error: unneeded return statement
- --> examples/needless_return.rs:30:13
+ --> needless_return.rs:30:13
|
30 | return true;
| ^^^^^^^^^^^^ help: remove `return` as shown: `true`
= note: `-D needless-return` implied by `-D warnings`
error: unneeded return statement
- --> examples/needless_return.rs:37:9
+ --> needless_return.rs:37:9
|
37 | return true;
| ^^^^^^^^^^^^ help: remove `return` as shown: `true`
= note: `-D needless-return` implied by `-D warnings`
error: unneeded return statement
- --> examples/needless_return.rs:39:16
+ --> needless_return.rs:39:16
|
39 | let _ = || return true;
| ^^^^^^^^^^^ help: remove `return` as shown: `true`
error: struct update has no effect, all the fields in the struct have already been specified
- --> examples/needless_update.rs:16:23
+ --> needless_update.rs:16:23
|
16 | S { a: 1, b: 1, ..base };
| ^^^^
error: Negation by multiplying with -1
- --> examples/neg_multiply.rs:30:5
+ --> neg_multiply.rs:30:5
|
30 | x * -1;
| ^^^^^^
= note: `-D neg-multiply` implied by `-D warnings`
error: Negation by multiplying with -1
- --> examples/neg_multiply.rs:32:5
+ --> neg_multiply.rs:32:5
|
32 | -1 * x;
| ^^^^^^
error: this loop never actually loops
- --> examples/never_loop.rs:8:5
+ --> never_loop.rs:8:5
|
8 | / loop {
9 | | println!("This is only ever printed once");
= note: `-D never-loop` implied by `-D warnings`
error: this loop never actually loops
- --> examples/never_loop.rs:21:5
+ --> never_loop.rs:21:5
|
21 | / loop {
22 | | loop {
= note: `-D never-loop` implied by `-D warnings`
error: this loop never actually loops
- --> examples/never_loop.rs:22:9
+ --> never_loop.rs:22:9
|
22 | / loop {
23 | | // another one
error: you should consider deriving a `Default` implementation for `Foo`
- --> examples/new_without_default.rs:10:5
+ --> new_without_default.rs:10:5
|
10 | pub fn new() -> Foo { Foo }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| #[derive(Default)]
error: you should consider deriving a `Default` implementation for `Bar`
- --> examples/new_without_default.rs:16:5
+ --> new_without_default.rs:16:5
|
16 | pub fn new() -> Self { Bar }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| #[derive(Default)]
error: you should consider adding a `Default` implementation for `LtKo<'c>`
- --> examples/new_without_default.rs:64:5
+ --> new_without_default.rs:64:5
|
64 | pub fn new() -> LtKo<'c> { unimplemented!() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: statement with no effect
- --> examples/no_effect.rs:34:5
+ --> no_effect.rs:34:5
|
34 | 0;
| ^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:35:5
+ --> no_effect.rs:35:5
|
35 | s2;
| ^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:36:5
+ --> no_effect.rs:36:5
|
36 | Unit;
| ^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:37:5
+ --> no_effect.rs:37:5
|
37 | Tuple(0);
| ^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:38:5
+ --> no_effect.rs:38:5
|
38 | Struct { field: 0 };
| ^^^^^^^^^^^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:39:5
+ --> no_effect.rs:39:5
|
39 | Struct { ..s };
| ^^^^^^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:40:5
+ --> no_effect.rs:40:5
|
40 | Union { a: 0 };
| ^^^^^^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:41:5
+ --> no_effect.rs:41:5
|
41 | Enum::Tuple(0);
| ^^^^^^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:42:5
+ --> no_effect.rs:42:5
|
42 | Enum::Struct { field: 0 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:43:5
+ --> no_effect.rs:43:5
|
43 | 5 + 6;
| ^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:44:5
+ --> no_effect.rs:44:5
|
44 | *&42;
| ^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:45:5
+ --> no_effect.rs:45:5
|
45 | &6;
| ^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:46:5
+ --> no_effect.rs:46:5
|
46 | (5, 6, 7);
| ^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:47:5
+ --> no_effect.rs:47:5
|
47 | box 42;
| ^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:48:5
+ --> no_effect.rs:48:5
|
48 | ..;
| ^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:49:5
+ --> no_effect.rs:49:5
|
49 | 5..;
| ^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:50:5
+ --> no_effect.rs:50:5
|
50 | ..5;
| ^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:51:5
+ --> no_effect.rs:51:5
|
51 | 5..6;
| ^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:52:5
+ --> no_effect.rs:52:5
|
52 | 5...6;
| ^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:53:5
+ --> no_effect.rs:53:5
|
53 | [42, 55];
| ^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:54:5
+ --> no_effect.rs:54:5
|
54 | [42, 55][1];
| ^^^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:55:5
+ --> no_effect.rs:55:5
|
55 | (42, 55).1;
| ^^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:56:5
+ --> no_effect.rs:56:5
|
56 | [42; 55];
| ^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:57:5
+ --> no_effect.rs:57:5
|
57 | [42; 55][13];
| ^^^^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement with no effect
- --> examples/no_effect.rs:59:5
+ --> no_effect.rs:59:5
|
59 | || x += 5;
| ^^^^^^^^^^
= note: `-D no-effect` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:65:5
+ --> no_effect.rs:65:5
|
65 | Tuple(get_number());
| ^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:66:5
+ --> no_effect.rs:66:5
|
66 | Struct { field: get_number() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:67:5
+ --> no_effect.rs:67:5
|
67 | Struct { ..get_struct() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_struct();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:68:5
+ --> no_effect.rs:68:5
|
68 | Enum::Tuple(get_number());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:69:5
+ --> no_effect.rs:69:5
|
69 | Enum::Struct { field: get_number() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:70:5
+ --> no_effect.rs:70:5
|
70 | 5 + get_number();
| ^^^^^^^^^^^^^^^^^ help: replace it with `5;get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:71:5
+ --> no_effect.rs:71:5
|
71 | *&get_number();
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:72:5
+ --> no_effect.rs:72:5
|
72 | &get_number();
| ^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:73:5
+ --> no_effect.rs:73:5
|
73 | (5, 6, get_number());
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with `5;6;get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:74:5
+ --> no_effect.rs:74:5
|
74 | box get_number();
| ^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:75:5
+ --> no_effect.rs:75:5
|
75 | get_number()..;
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:76:5
+ --> no_effect.rs:76:5
|
76 | ..get_number();
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:77:5
+ --> no_effect.rs:77:5
|
77 | 5..get_number();
| ^^^^^^^^^^^^^^^^ help: replace it with `5;get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:78:5
+ --> no_effect.rs:78:5
|
78 | [42, get_number()];
| ^^^^^^^^^^^^^^^^^^^ help: replace it with `42;get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:79:5
+ --> no_effect.rs:79:5
|
79 | [42, 55][get_number() as usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `[42, 55];get_number() as usize;`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:80:5
+ --> no_effect.rs:80:5
|
80 | (42, get_number()).1;
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with `42;get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:81:5
+ --> no_effect.rs:81:5
|
81 | [get_number(); 55];
| ^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:82:5
+ --> no_effect.rs:82:5
|
82 | [42; 55][get_number() as usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `[42; 55];get_number() as usize;`
= note: `-D unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
- --> examples/no_effect.rs:83:5
+ --> no_effect.rs:83:5
|
83 | {get_number()};
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: binding's name is too similar to existing binding
- --> examples/non_expressive_names.rs:18:9
+ --> non_expressive_names.rs:18:9
|
18 | let bpple: i32;
| ^^^^^
|
= note: `-D similar-names` implied by `-D warnings`
note: existing binding defined here
- --> examples/non_expressive_names.rs:16:9
+ --> non_expressive_names.rs:16:9
|
16 | let apple: i32;
| ^^^^^
help: separate the discriminating character by an underscore like: `b_pple`
- --> examples/non_expressive_names.rs:18:9
+ --> non_expressive_names.rs:18:9
|
18 | let bpple: i32;
| ^^^^^
error: binding's name is too similar to existing binding
- --> examples/non_expressive_names.rs:20:9
+ --> non_expressive_names.rs:20:9
|
20 | let cpple: i32;
| ^^^^^
|
= note: `-D similar-names` implied by `-D warnings`
note: existing binding defined here
- --> examples/non_expressive_names.rs:16:9
+ --> non_expressive_names.rs:16:9
|
16 | let apple: i32;
| ^^^^^
help: separate the discriminating character by an underscore like: `c_pple`
- --> examples/non_expressive_names.rs:20:9
+ --> non_expressive_names.rs:20:9
|
20 | let cpple: i32;
| ^^^^^
error: binding's name is too similar to existing binding
- --> examples/non_expressive_names.rs:45:9
+ --> non_expressive_names.rs:45:9
|
45 | let bluby: i32;
| ^^^^^
|
= note: `-D similar-names` implied by `-D warnings`
note: existing binding defined here
- --> examples/non_expressive_names.rs:44:9
+ --> non_expressive_names.rs:44:9
|
44 | let blubx: i32;
| ^^^^^
help: separate the discriminating character by an underscore like: `blub_y`
- --> examples/non_expressive_names.rs:45:9
+ --> non_expressive_names.rs:45:9
|
45 | let bluby: i32;
| ^^^^^
error: binding's name is too similar to existing binding
- --> examples/non_expressive_names.rs:50:9
+ --> non_expressive_names.rs:50:9
|
50 | let coke: i32;
| ^^^^
|
= note: `-D similar-names` implied by `-D warnings`
note: existing binding defined here
- --> examples/non_expressive_names.rs:48:9
+ --> non_expressive_names.rs:48:9
|
48 | let cake: i32;
| ^^^^
error: binding's name is too similar to existing binding
- --> examples/non_expressive_names.rs:68:9
+ --> non_expressive_names.rs:68:9
|
68 | let xyzeabc: i32;
| ^^^^^^^
|
= note: `-D similar-names` implied by `-D warnings`
note: existing binding defined here
- --> examples/non_expressive_names.rs:66:9
+ --> non_expressive_names.rs:66:9
|
66 | let xyz1abc: i32;
| ^^^^^^^
error: binding's name is too similar to existing binding
- --> examples/non_expressive_names.rs:72:9
+ --> non_expressive_names.rs:72:9
|
72 | let parsee: i32;
| ^^^^^^
|
= note: `-D similar-names` implied by `-D warnings`
note: existing binding defined here
- --> examples/non_expressive_names.rs:70:9
+ --> non_expressive_names.rs:70:9
|
70 | let parser: i32;
| ^^^^^^
help: separate the discriminating character by an underscore like: `parse_e`
- --> examples/non_expressive_names.rs:72:9
+ --> non_expressive_names.rs:72:9
|
72 | let parsee: i32;
| ^^^^^^
error: binding's name is too similar to existing binding
- --> examples/non_expressive_names.rs:86:16
+ --> non_expressive_names.rs:86:16
|
86 | bpple: sprang } = unimplemented!();
| ^^^^^^
|
= note: `-D similar-names` implied by `-D warnings`
note: existing binding defined here
- --> examples/non_expressive_names.rs:85:22
+ --> non_expressive_names.rs:85:22
|
85 | let Foo { apple: spring,
| ^^^^^^
error: 5th binding whose name is just one char
- --> examples/non_expressive_names.rs:120:17
+ --> non_expressive_names.rs:120:17
|
120 | let e: i32;
| ^
= note: `-D many-single-char-names` implied by `-D warnings`
error: 5th binding whose name is just one char
- --> examples/non_expressive_names.rs:123:17
+ --> non_expressive_names.rs:123:17
|
123 | let e: i32;
| ^
= note: `-D many-single-char-names` implied by `-D warnings`
error: 6th binding whose name is just one char
- --> examples/non_expressive_names.rs:124:17
+ --> non_expressive_names.rs:124:17
|
124 | let f: i32;
| ^
= note: `-D many-single-char-names` implied by `-D warnings`
error: 5th binding whose name is just one char
- --> examples/non_expressive_names.rs:129:13
+ --> non_expressive_names.rs:129:13
|
129 | e => panic!(),
| ^
error: Matching on `Some` with `ok()` is redundant
- --> examples/ok_if_let.rs:7:5
+ --> ok_if_let.rs:7:5
|
7 | / if let Some(y) = x.parse().ok() {
8 | | y
error: needlessly taken reference of both operands
- --> examples/op_ref.rs:13:15
+ --> op_ref.rs:13:15
|
13 | let foo = &5 - &6;
| ^^^^^^^
error: file opened with "truncate" and "read"
- --> examples/open_options.rs:8:5
+ --> open_options.rs:8:5
|
8 | OpenOptions::new().read(true).truncate(true).open("foo.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D nonsensical-open-options` implied by `-D warnings`
error: file opened with "append" and "truncate"
- --> examples/open_options.rs:9:5
+ --> open_options.rs:9:5
|
9 | OpenOptions::new().append(true).truncate(true).open("foo.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D nonsensical-open-options` implied by `-D warnings`
error: the method "read" is called more than once
- --> examples/open_options.rs:11:5
+ --> open_options.rs:11:5
|
11 | OpenOptions::new().read(true).read(false).open("foo.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D nonsensical-open-options` implied by `-D warnings`
error: the method "create" is called more than once
- --> examples/open_options.rs:12:5
+ --> open_options.rs:12:5
|
12 | OpenOptions::new().create(true).create(false).open("foo.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D nonsensical-open-options` implied by `-D warnings`
error: the method "write" is called more than once
- --> examples/open_options.rs:13:5
+ --> open_options.rs:13:5
|
13 | OpenOptions::new().write(true).write(false).open("foo.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D nonsensical-open-options` implied by `-D warnings`
error: the method "append" is called more than once
- --> examples/open_options.rs:14:5
+ --> open_options.rs:14:5
|
14 | OpenOptions::new().append(true).append(false).open("foo.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D nonsensical-open-options` implied by `-D warnings`
error: the method "truncate" is called more than once
- --> examples/open_options.rs:15:5
+ --> open_options.rs:15:5
|
15 | OpenOptions::new().truncate(true).truncate(false).open("foo.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: You are trying to use classic C overflow conditions that will fail in Rust.
- --> examples/overflow_check_conditional.rs:11:5
+ --> overflow_check_conditional.rs:11:5
|
11 | if a + b < a {
| ^^^^^^^^^
= note: `-D overflow-check-conditional` implied by `-D warnings`
error: You are trying to use classic C overflow conditions that will fail in Rust.
- --> examples/overflow_check_conditional.rs:14:5
+ --> overflow_check_conditional.rs:14:5
|
14 | if a > a + b {
| ^^^^^^^^^
= note: `-D overflow-check-conditional` implied by `-D warnings`
error: You are trying to use classic C overflow conditions that will fail in Rust.
- --> examples/overflow_check_conditional.rs:17:5
+ --> overflow_check_conditional.rs:17:5
|
17 | if a + b < b {
| ^^^^^^^^^
= note: `-D overflow-check-conditional` implied by `-D warnings`
error: You are trying to use classic C overflow conditions that will fail in Rust.
- --> examples/overflow_check_conditional.rs:20:5
+ --> overflow_check_conditional.rs:20:5
|
20 | if b > a + b {
| ^^^^^^^^^
= note: `-D overflow-check-conditional` implied by `-D warnings`
error: You are trying to use classic C underflow conditions that will fail in Rust.
- --> examples/overflow_check_conditional.rs:23:5
+ --> overflow_check_conditional.rs:23:5
|
23 | if a - b > b {
| ^^^^^^^^^
= note: `-D overflow-check-conditional` implied by `-D warnings`
error: You are trying to use classic C underflow conditions that will fail in Rust.
- --> examples/overflow_check_conditional.rs:26:5
+ --> overflow_check_conditional.rs:26:5
|
26 | if b < a - b {
| ^^^^^^^^^
= note: `-D overflow-check-conditional` implied by `-D warnings`
error: You are trying to use classic C underflow conditions that will fail in Rust.
- --> examples/overflow_check_conditional.rs:29:5
+ --> overflow_check_conditional.rs:29:5
|
29 | if a - b > a {
| ^^^^^^^^^
= note: `-D overflow-check-conditional` implied by `-D warnings`
error: You are trying to use classic C underflow conditions that will fail in Rust.
- --> examples/overflow_check_conditional.rs:32:5
+ --> overflow_check_conditional.rs:32:5
|
32 | if a < a - b {
| ^^^^^^^^^
error: you probably are missing some parameter in your format string
- --> examples/panic.rs:8:16
+ --> panic.rs:8:16
|
8 | panic!("{}");
| ^^^^
= note: `-D panic-params` implied by `-D warnings`
error: you probably are missing some parameter in your format string
- --> examples/panic.rs:10:16
+ --> panic.rs:10:16
|
10 | panic!("{:?}");
| ^^^^^^
= note: `-D panic-params` implied by `-D warnings`
error: you probably are missing some parameter in your format string
- --> examples/panic.rs:12:23
+ --> panic.rs:12:23
|
12 | assert!(true, "here be missing values: {}");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D panic-params` implied by `-D warnings`
error: you probably are missing some parameter in your format string
- --> examples/panic.rs:22:5
+ --> panic.rs:22:5
|
22 | assert!("foo bar".contains(&format!("foo {}", "bar")));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: re-implementing `PartialEq::ne` is unnecessary
- --> examples/partialeq_ne_impl.rs:10:5
+ --> partialeq_ne_impl.rs:10:5
|
10 | fn ne(&self, _: &Foo) -> bool { false }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the `y @ _` pattern can be written as just `y`
- --> examples/patterns.rs:10:9
+ --> patterns.rs:10:9
|
10 | y @ _ => (),
| ^^^^^
error: operator precedence can trip the unwary
- --> examples/precedence.rs:8:5
+ --> precedence.rs:8:5
|
8 | 1 << 2 + 3;
| ^^^^^^^^^^ help: consider parenthesizing your expression `1 << (2 + 3)`
= note: `-D precedence` implied by `-D warnings`
error: operator precedence can trip the unwary
- --> examples/precedence.rs:9:5
+ --> precedence.rs:9:5
|
9 | 1 + 2 << 3;
| ^^^^^^^^^^ help: consider parenthesizing your expression `(1 + 2) << 3`
= note: `-D precedence` implied by `-D warnings`
error: operator precedence can trip the unwary
- --> examples/precedence.rs:10:5
+ --> precedence.rs:10:5
|
10 | 4 >> 1 + 1;
| ^^^^^^^^^^ help: consider parenthesizing your expression `4 >> (1 + 1)`
= note: `-D precedence` implied by `-D warnings`
error: operator precedence can trip the unwary
- --> examples/precedence.rs:11:5
+ --> precedence.rs:11:5
|
11 | 1 + 3 >> 2;
| ^^^^^^^^^^ help: consider parenthesizing your expression `(1 + 3) >> 2`
= note: `-D precedence` implied by `-D warnings`
error: operator precedence can trip the unwary
- --> examples/precedence.rs:12:5
+ --> precedence.rs:12:5
|
12 | 1 ^ 1 - 1;
| ^^^^^^^^^ help: consider parenthesizing your expression `1 ^ (1 - 1)`
= note: `-D precedence` implied by `-D warnings`
error: operator precedence can trip the unwary
- --> examples/precedence.rs:13:5
+ --> precedence.rs:13:5
|
13 | 3 | 2 - 1;
| ^^^^^^^^^ help: consider parenthesizing your expression `3 | (2 - 1)`
= note: `-D precedence` implied by `-D warnings`
error: operator precedence can trip the unwary
- --> examples/precedence.rs:14:5
+ --> precedence.rs:14:5
|
14 | 3 & 5 - 2;
| ^^^^^^^^^ help: consider parenthesizing your expression `3 & (5 - 2)`
= note: `-D precedence` implied by `-D warnings`
error: unary minus has lower precedence than method call
- --> examples/precedence.rs:15:5
+ --> precedence.rs:15:5
|
15 | -1i32.abs();
| ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent `-(1i32.abs())`
= note: `-D precedence` implied by `-D warnings`
error: unary minus has lower precedence than method call
- --> examples/precedence.rs:16:5
+ --> precedence.rs:16:5
|
16 | -1f32.abs();
| ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent `-(1f32.abs())`
error: use of `Debug`-based formatting
- --> examples/print.rs:12:27
+ --> print.rs:12:27
|
12 | write!(f, "{:?}", 43.1415)
| ^^^^^^^
= note: `-D use-debug` implied by `-D warnings`
error: use of `println!`
- --> examples/print.rs:24:5
+ --> print.rs:24:5
|
24 | println!("Hello");
| ^^^^^^^^^^^^^^^^^^
= note: `-D print-stdout` implied by `-D warnings`
error: use of `print!`
- --> examples/print.rs:25:5
+ --> print.rs:25:5
|
25 | print!("Hello");
| ^^^^^^^^^^^^^^^^
= note: `-D print-stdout` implied by `-D warnings`
error: use of `print!`
- --> examples/print.rs:27:5
+ --> print.rs:27:5
|
27 | print!("Hello {}", "World");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D print-stdout` implied by `-D warnings`
error: use of `print!`
- --> examples/print.rs:29:5
+ --> print.rs:29:5
|
29 | print!("Hello {:?}", "World");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D print-stdout` implied by `-D warnings`
error: use of `Debug`-based formatting
- --> examples/print.rs:29:26
+ --> print.rs:29:26
|
29 | print!("Hello {:?}", "World");
| ^^^^^^^
= note: `-D use-debug` implied by `-D warnings`
error: use of `print!`
- --> examples/print.rs:31:5
+ --> print.rs:31:5
|
31 | print!("Hello {:#?}", "#orld");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D print-stdout` implied by `-D warnings`
error: use of `Debug`-based formatting
- --> examples/print.rs:31:27
+ --> print.rs:31:27
|
31 | print!("Hello {:#?}", "#orld");
| ^^^^^^^
error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead
- --> examples/print_with_newline.rs:6:5
+ --> print_with_newline.rs:6:5
|
6 | print!("Hello\n");
| ^^^^^^^^^^^^^^^^^^
= note: `-D print-with-newline` implied by `-D warnings`
error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead
- --> examples/print_with_newline.rs:7:5
+ --> print_with_newline.rs:7:5
|
7 | print!("Hello {}\n", "world");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D print-with-newline` implied by `-D warnings`
error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead
- --> examples/print_with_newline.rs:8:5
+ --> print_with_newline.rs:8:5
|
8 | print!("Hello {} {}\n\n", "world", "#2");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D print-with-newline` implied by `-D warnings`
error: using `print!()` with a format string that ends in a newline, consider using `println!()` instead
- --> examples/print_with_newline.rs:9:5
+ --> print_with_newline.rs:9:5
|
9 | print!("{}\n", 1265);
| ^^^^^^^^^^^^^^^^^^^^^
error: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. Consider changing the type to `&[...]`
- --> examples/ptr_arg.rs:6:14
+ --> ptr_arg.rs:6:14
|
6 | fn do_vec(x: &Vec<i64>) {
| ^^^^^^^^^
= note: `-D ptr-arg` implied by `-D warnings`
error: writing `&String` instead of `&str` involves a new object where a slice will do. Consider changing the type to `&str`
- --> examples/ptr_arg.rs:14:14
+ --> ptr_arg.rs:14:14
|
14 | fn do_str(x: &String) {
| ^^^^^^^
= note: `-D ptr-arg` implied by `-D warnings`
error: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. Consider changing the type to `&[...]`
- --> examples/ptr_arg.rs:27:18
+ --> ptr_arg.rs:27:18
|
27 | fn do_vec(x: &Vec<i64>);
| ^^^^^^^^^
error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead
- --> examples/range.rs:13:5
+ --> range.rs:13:5
|
13 | (0..1).step_by(0);
| ^^^^^^^^^^^^^^^^^
= note: `-D range-step-by-zero` implied by `-D warnings`
error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead
- --> examples/range.rs:17:5
+ --> range.rs:17:5
|
17 | (1..).step_by(0);
| ^^^^^^^^^^^^^^^^
= note: `-D range-step-by-zero` implied by `-D warnings`
error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead
- --> examples/range.rs:18:5
+ --> range.rs:18:5
|
18 | (1...2).step_by(0);
| ^^^^^^^^^^^^^^^^^^
= note: `-D range-step-by-zero` implied by `-D warnings`
error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead
- --> examples/range.rs:21:5
+ --> range.rs:21:5
|
21 | x.step_by(0);
| ^^^^^^^^^^^^
= note: `-D range-step-by-zero` implied by `-D warnings`
error: It is more idiomatic to use v1.iter().enumerate()
- --> examples/range.rs:29:14
+ --> range.rs:29:14
|
29 | let _x = v1.iter().zip(0..v1.len());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Closure called just once immediately after it was declared
- --> examples/redundant_closure_call.rs:15:2
+ --> redundant_closure_call.rs:15:2
|
15 | i = closure();
| ^^^^^^^^^^^^^
= note: `-D redundant-closure-call` implied by `-D warnings`
error: Closure called just once immediately after it was declared
- --> examples/redundant_closure_call.rs:18:2
+ --> redundant_closure_call.rs:18:2
|
18 | i = closure(3);
| ^^^^^^^^^^^^^^
= note: `-D redundant-closure-call` implied by `-D warnings`
error: Try not to call a closure in the expression where it is declared.
- --> examples/redundant_closure_call.rs:7:10
+ --> redundant_closure_call.rs:7:10
|
7 | let a = (|| 42)();
| ^^^^^^^^^ help: Try doing something like: `42`
= note: `-D redundant-closure-call` implied by `-D warnings`
error: Try not to call a closure in the expression where it is declared.
- --> examples/redundant_closure_call.rs:10:14
+ --> redundant_closure_call.rs:10:14
|
10 | let mut k = (|m| m+1)(i);
| ^^^^^^^^^^^^
= note: `-D redundant-closure-call` implied by `-D warnings`
error: Try not to call a closure in the expression where it is declared.
- --> examples/redundant_closure_call.rs:12:6
+ --> redundant_closure_call.rs:12:6
|
12 | k = (|a,b| a*b)(1,5);
| ^^^^^^^^^^^^^^^^
error: immediately dereferencing a reference
- --> examples/reference.rs:19:13
+ --> reference.rs:19:13
|
19 | let b = *&a;
| ^^^ help: try this `a`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:21:13
+ --> reference.rs:21:13
|
21 | let b = *&get_number();
| ^^^^^^^^^^^^^^ help: try this `get_number()`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:26:13
+ --> reference.rs:26:13
|
26 | let b = *&bytes[1..2][0];
| ^^^^^^^^^^^^^^^^ help: try this `bytes[1..2][0]`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:30:13
+ --> reference.rs:30:13
|
30 | let b = *&(a);
| ^^^^^ help: try this `(a)`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:32:13
+ --> reference.rs:32:13
|
32 | let b = *(&a);
| ^^^^^ help: try this `a`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:34:13
+ --> reference.rs:34:13
|
34 | let b = *((&a));
| ^^^^^^^ help: try this `a`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:36:13
+ --> reference.rs:36:13
|
36 | let b = *&&a;
| ^^^^ help: try this `&a`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:38:14
+ --> reference.rs:38:14
|
38 | let b = **&aref;
| ^^^^^^ help: try this `aref`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:42:14
+ --> reference.rs:42:14
|
42 | let b = **&&a;
| ^^^^ help: try this `&a`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:46:17
+ --> reference.rs:46:17
|
46 | let y = *&mut x;
| ^^^^^^^ help: try this `x`
= note: `-D deref-addrof` implied by `-D warnings`
error: immediately dereferencing a reference
- --> examples/reference.rs:53:18
+ --> reference.rs:53:18
|
53 | let y = **&mut &mut x;
| ^^^^^^^^^^^^ help: try this `&mut x`
error[E0463]: can't find crate for `regex`
- --> examples/regex.rs:7:1
+ --> regex.rs:7:1
|
7 | extern crate regex;
| ^^^^^^^^^^^^^^^^^^^ can't find crate
error[E0463]: can't find crate for `serde`
- --> examples/serde.rs:6:1
+ --> serde.rs:6:1
|
6 | extern crate serde;
| ^^^^^^^^^^^^^^^^^^^ can't find crate
error: `x` is shadowed by itself in `&mut x`
- --> examples/shadow.rs:13:9
+ --> shadow.rs:13:9
|
13 | let x = &mut x;
| ^^^^^^^^^^
|
= note: `-D shadow-same` implied by `-D warnings`
note: previous binding is here
- --> examples/shadow.rs:12:13
+ --> shadow.rs:12:13
|
12 | let mut x = 1;
| ^
error: `x` is shadowed by itself in `{ x }`
- --> examples/shadow.rs:14:9
+ --> shadow.rs:14:9
|
14 | let x = { x };
| ^^^^^^^^^
|
= note: `-D shadow-same` implied by `-D warnings`
note: previous binding is here
- --> examples/shadow.rs:13:9
+ --> shadow.rs:13:9
|
13 | let x = &mut x;
| ^
error: `x` is shadowed by itself in `(&*x)`
- --> examples/shadow.rs:15:9
+ --> shadow.rs:15:9
|
15 | let x = (&*x);
| ^^^^^^^^^
|
= note: `-D shadow-same` implied by `-D warnings`
note: previous binding is here
- --> examples/shadow.rs:14:9
+ --> shadow.rs:14:9
|
14 | let x = { x };
| ^
error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
- --> examples/shadow.rs:16:9
+ --> shadow.rs:16:9
|
16 | let x = { *x + 1 };
| ^
|
= note: `-D shadow-reuse` implied by `-D warnings`
note: initialization happens here
- --> examples/shadow.rs:16:13
+ --> shadow.rs:16:13
|
16 | let x = { *x + 1 };
| ^^^^^^^^^^
note: previous binding is here
- --> examples/shadow.rs:15:9
+ --> shadow.rs:15:9
|
15 | let x = (&*x);
| ^
error: `x` is shadowed by `id(x)` which reuses the original value
- --> examples/shadow.rs:17:9
+ --> shadow.rs:17:9
|
17 | let x = id(x);
| ^
|
= note: `-D shadow-reuse` implied by `-D warnings`
note: initialization happens here
- --> examples/shadow.rs:17:13
+ --> shadow.rs:17:13
|
17 | let x = id(x);
| ^^^^^
note: previous binding is here
- --> examples/shadow.rs:16:9
+ --> shadow.rs:16:9
|
16 | let x = { *x + 1 };
| ^
error: `x` is shadowed by `(1, x)` which reuses the original value
- --> examples/shadow.rs:18:9
+ --> shadow.rs:18:9
|
18 | let x = (1, x);
| ^
|
= note: `-D shadow-reuse` implied by `-D warnings`
note: initialization happens here
- --> examples/shadow.rs:18:13
+ --> shadow.rs:18:13
|
18 | let x = (1, x);
| ^^^^^^
note: previous binding is here
- --> examples/shadow.rs:17:9
+ --> shadow.rs:17:9
|
17 | let x = id(x);
| ^
error: `x` is shadowed by `first(x)` which reuses the original value
- --> examples/shadow.rs:19:9
+ --> shadow.rs:19:9
|
19 | let x = first(x);
| ^
|
= note: `-D shadow-reuse` implied by `-D warnings`
note: initialization happens here
- --> examples/shadow.rs:19:13
+ --> shadow.rs:19:13
|
19 | let x = first(x);
| ^^^^^^^^
note: previous binding is here
- --> examples/shadow.rs:18:9
+ --> shadow.rs:18:9
|
18 | let x = (1, x);
| ^
error: `x` is shadowed by `y`
- --> examples/shadow.rs:21:9
+ --> shadow.rs:21:9
|
21 | let x = y;
| ^
|
= note: `-D shadow-unrelated` implied by `-D warnings`
note: initialization happens here
- --> examples/shadow.rs:21:13
+ --> shadow.rs:21:13
|
21 | let x = y;
| ^
note: previous binding is here
- --> examples/shadow.rs:19:9
+ --> shadow.rs:19:9
|
19 | let x = first(x);
| ^
error: `x` shadows a previous declaration
- --> examples/shadow.rs:23:9
+ --> shadow.rs:23:9
|
23 | let x;
| ^
|
= note: `-D shadow-unrelated` implied by `-D warnings`
note: previous binding is here
- --> examples/shadow.rs:21:9
+ --> shadow.rs:21:9
|
21 | let x = y;
| ^
error: boolean short circuit operator in statement may be clearer using an explicit test
- --> examples/short_circuit_statement.rs:7:5
+ --> short_circuit_statement.rs:7:5
|
7 | f() && g();
| ^^^^^^^^^^^ help: replace it with `if f() { g(); }`
= note: `-D short-circuit-statement` implied by `-D warnings`
error: boolean short circuit operator in statement may be clearer using an explicit test
- --> examples/short_circuit_statement.rs:8:5
+ --> short_circuit_statement.rs:8:5
|
8 | f() || g();
| ^^^^^^^^^^^ help: replace it with `if !f() { g(); }`
= note: `-D short-circuit-statement` implied by `-D warnings`
error: boolean short circuit operator in statement may be clearer using an explicit test
- --> examples/short_circuit_statement.rs:9:5
+ --> short_circuit_statement.rs:9:5
|
9 | 1 == 2 || g();
| ^^^^^^^^^^^^^^ help: replace it with `if !(1 == 2) { g(); }`
error: use `assert_eq` for better reporting
- --> examples/should_assert_eq.rs:14:5
+ --> should_assert_eq.rs:14:5
|
14 | assert!(1 == 2);
| ^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
error: use `assert_eq` for better reporting
- --> examples/should_assert_eq.rs:15:5
+ --> should_assert_eq.rs:15:5
|
15 | assert!(Debug(1) == Debug(2));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
error: use `assert_ne` for better reporting
- --> examples/should_assert_eq.rs:17:5
+ --> should_assert_eq.rs:17:5
|
17 | assert!(Debug(1) != Debug(2));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
error: use `debug_assert_eq` for better reporting
- --> examples/should_assert_eq.rs:22:5
+ --> should_assert_eq.rs:22:5
|
22 | debug_assert!(4 == 5);
| ^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
error: use `debug_assert_ne` for better reporting
- --> examples/should_assert_eq.rs:23:5
+ --> should_assert_eq.rs:23:5
|
23 | debug_assert!(4 != 6);
| ^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
error: use `assert_eq` for better reporting
- --> examples/should_assert_eq.rs:27:5
+ --> should_assert_eq.rs:27:5
|
27 | assert!(x == y);
| ^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
error: use `assert_ne` for better reporting
- --> examples/should_assert_eq.rs:30:5
+ --> should_assert_eq.rs:30:5
|
30 | assert!(x != y);
| ^^^^^^^^^^^^^^^^
error: you added something to a string. Consider using `String::push_str()` instead
- --> examples/strings.rs:10:13
+ --> strings.rs:10:13
|
10 | x = x + ".";
| ^^^^^^^
= note: `-D string-add` implied by `-D warnings`
error: you added something to a string. Consider using `String::push_str()` instead
- --> examples/strings.rs:14:13
+ --> strings.rs:14:13
|
14 | let z = y + "...";
| ^^^^^^^^^
= note: `-D string-add` implied by `-D warnings`
error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
- --> examples/strings.rs:24:9
+ --> strings.rs:24:9
|
24 | x = x + ".";
| ^^^^^^^^^^^
= note: `-D string-add-assign` implied by `-D warnings`
error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
- --> examples/strings.rs:38:9
+ --> strings.rs:38:9
|
38 | x = x + ".";
| ^^^^^^^^^^^
= note: `-D string-add-assign` implied by `-D warnings`
error: you added something to a string. Consider using `String::push_str()` instead
- --> examples/strings.rs:42:13
+ --> strings.rs:42:13
|
42 | let z = y + "...";
| ^^^^^^^^^
= note: `-D string-add` implied by `-D warnings`
error: calling `as_bytes()` on a string literal
- --> examples/strings.rs:50:14
+ --> strings.rs:50:14
|
50 | let bs = "hello there".as_bytes();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead `b"hello there"`
= note: `-D string-lit-as-bytes` implied by `-D warnings`
error: manual implementation of an assign operation
- --> examples/strings.rs:65:7
+ --> strings.rs:65:7
|
65 | ; x = x + 1;
| ^^^^^^^^^ help: replace it with `x += 1`
error: item name starts with its containing module's name
- --> examples/stutter.rs:8:5
+ --> stutter.rs:8:5
|
8 | pub fn foo_bar() {}
| ^^^^^^^^^^^^^^^^^^^
= note: `-D stutter` implied by `-D warnings`
error: item name ends with its containing module's name
- --> examples/stutter.rs:9:5
+ --> stutter.rs:9:5
|
9 | pub fn bar_foo() {}
| ^^^^^^^^^^^^^^^^^^^
= note: `-D stutter` implied by `-D warnings`
error: item name starts with its containing module's name
- --> examples/stutter.rs:10:5
+ --> stutter.rs:10:5
|
10 | pub struct FooCake {}
| ^^^^^^^^^^^^^^^^^^^^^
= note: `-D stutter` implied by `-D warnings`
error: item name ends with its containing module's name
- --> examples/stutter.rs:11:5
+ --> stutter.rs:11:5
|
11 | pub enum CakeFoo {}
| ^^^^^^^^^^^^^^^^^^^
error: this looks like you are swapping elements of `foo` manually
- --> examples/swap.rs:11:5
+ --> swap.rs:11:5
|
11 | / let temp = foo[0];
12 | | foo[0] = foo[1];
= note: `-D manual-swap` implied by `-D warnings`
error: this looks like you are swapping elements of `foo` manually
- --> examples/swap.rs:20:5
+ --> swap.rs:20:5
|
20 | / let temp = foo[0];
21 | | foo[0] = foo[1];
= note: `-D manual-swap` implied by `-D warnings`
error: this looks like you are swapping elements of `foo` manually
- --> examples/swap.rs:29:5
+ --> swap.rs:29:5
|
29 | / let temp = foo[0];
30 | | foo[0] = foo[1];
= note: `-D manual-swap` implied by `-D warnings`
error: this looks like you are swapping `a` and `b` manually
- --> examples/swap.rs:47:7
+ --> swap.rs:47:7
|
47 | ; let t = a;
| _______^
= note: or maybe you should use `std::mem::replace`?
error: this looks like you are swapping `c.0` and `a` manually
- --> examples/swap.rs:56:7
+ --> swap.rs:56:7
|
56 | ; let t = c.0;
| _______^
= note: or maybe you should use `std::mem::replace`?
error: this looks like you are trying to swap `a` and `b`
- --> examples/swap.rs:44:5
+ --> swap.rs:44:5
|
44 | / a = b;
45 | | b = a;
= note: or maybe you should use `std::mem::replace`?
error: this looks like you are trying to swap `c.0` and `a`
- --> examples/swap.rs:53:5
+ --> swap.rs:53:5
|
53 | / c.0 = a;
54 | | a = c.0;
error: assignment to temporary
- --> examples/temporary_assignment.rs:29:5
+ --> temporary_assignment.rs:29:5
|
29 | Struct { field: 0 }.field = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D temporary-assignment` implied by `-D warnings`
error: assignment to temporary
- --> examples/temporary_assignment.rs:30:5
+ --> temporary_assignment.rs:30:5
|
30 | (0, 0).0 = 1;
| ^^^^^^^^^^^^
error: `ref` directly on a function argument is ignored. Consider using a reference type instead.
- --> examples/toplevel_ref_arg.rs:7:15
+ --> toplevel_ref_arg.rs:7:15
|
7 | fn the_answer(ref mut x: u8) {
| ^^^^^^^^^
= note: `-D toplevel-ref-arg` implied by `-D warnings`
error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
- --> examples/toplevel_ref_arg.rs:18:7
+ --> toplevel_ref_arg.rs:18:7
|
18 | let ref x = 1;
| ----^^^^^----- help: try `let x = &1;`
= note: `-D toplevel-ref-arg` implied by `-D warnings`
error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
- --> examples/toplevel_ref_arg.rs:20:7
+ --> toplevel_ref_arg.rs:20:7
|
20 | let ref y: (&_, u8) = (&1, 2);
| ----^^^^^--------------------- help: try `let y: &(&_, u8) = &(&1, 2);`
= note: `-D toplevel-ref-arg` implied by `-D warnings`
error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
- --> examples/toplevel_ref_arg.rs:22:7
+ --> toplevel_ref_arg.rs:22:7
|
22 | let ref z = 1 + 2;
| ----^^^^^--------- help: try `let z = &(1 + 2);`
= note: `-D toplevel-ref-arg` implied by `-D warnings`
error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
- --> examples/toplevel_ref_arg.rs:24:7
+ --> toplevel_ref_arg.rs:24:7
|
24 | let ref mut z = 1 + 2;
| ----^^^^^^^^^--------- help: try `let z = &mut (1 + 2);`
error: zero-width space detected
- --> examples/unicode.rs:6:12
+ --> unicode.rs:6:12
|
6 | print!("Here >< is a ZWS, and another");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
""Here >\u{200B}< is a ZWS, and \u{200B}another""
error: non-nfc unicode sequence detected
- --> examples/unicode.rs:12:12
+ --> unicode.rs:12:12
|
12 | print!("̀àh?");
| ^^^^^^^
""̀àh?""
error: literal non-ASCII character detected
- --> examples/unicode.rs:18:12
+ --> unicode.rs:18:12
|
18 | print!("Üben!");
| ^^^^^^^
error: ==-comparison of unit values detected. This will always be true
- --> examples/unit_cmp.rs:16:8
+ --> unit_cmp.rs:16:8
|
16 | if { true; } == { false; } {
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D unit-cmp` implied by `-D warnings`
error: >-comparison of unit values detected. This will always be false
- --> examples/unit_cmp.rs:19:8
+ --> unit_cmp.rs:19:8
|
19 | if { true; } > { false; } {
| ^^^^^^^^^^^^^^^^^^^^^^
error: You matched a field with a wildcard pattern. Consider using `..` instead
- --> examples/unneeded_field_pattern.rs:17:15
+ --> unneeded_field_pattern.rs:17:15
|
17 | Foo { a: _, b: 0, .. } => {}
| ^^^^
= help: Try with `Foo { b: 0, .. }`
error: All the struct fields are matched to a wildcard pattern, consider using `..`.
- --> examples/unneeded_field_pattern.rs:19:9
+ --> unneeded_field_pattern.rs:19:9
|
19 | Foo { a: _, b: _, c: _ } => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: removed "unsafe" from the name of `UnsafeCell` in use as `TotallySafeCell`
- --> examples/unsafe_removed_from_name.rs:7:1
+ --> unsafe_removed_from_name.rs:7:1
|
7 | use std::cell::{UnsafeCell as TotallySafeCell};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D unsafe-removed-from-name` implied by `-D warnings`
error: removed "unsafe" from the name of `UnsafeCell` in use as `TotallySafeCellAgain`
- --> examples/unsafe_removed_from_name.rs:9:1
+ --> unsafe_removed_from_name.rs:9:1
|
9 | use std::cell::UnsafeCell as TotallySafeCellAgain;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D unsafe-removed-from-name` implied by `-D warnings`
error: removed "unsafe" from the name of `Unsafe` in use as `LieAboutModSafety`
- --> examples/unsafe_removed_from_name.rs:23:1
+ --> unsafe_removed_from_name.rs:23:1
|
23 | use mod_with_some_unsafe_things::Unsafe as LieAboutModSafety;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: handle written amount returned or use `Write::write_all` instead
- --> examples/unused_io_amount.rs:11:5
+ --> unused_io_amount.rs:11:5
|
11 | try!(s.write(b"test"));
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
error: handle read amount returned or use `Read::read_exact` instead
- --> examples/unused_io_amount.rs:13:5
+ --> unused_io_amount.rs:13:5
|
13 | try!(s.read(&mut buf));
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
error: handle written amount returned or use `Write::write_all` instead
- --> examples/unused_io_amount.rs:18:5
+ --> unused_io_amount.rs:18:5
|
18 | s.write(b"test")?;
| ^^^^^^^^^^^^^^^^^
= note: `-D unused-io-amount` implied by `-D warnings`
error: handle read amount returned or use `Read::read_exact` instead
- --> examples/unused_io_amount.rs:20:5
+ --> unused_io_amount.rs:20:5
|
20 | s.read(&mut buf)?;
| ^^^^^^^^^^^^^^^^^
= note: `-D unused-io-amount` implied by `-D warnings`
error: handle written amount returned or use `Write::write_all` instead
- --> examples/unused_io_amount.rs:25:5
+ --> unused_io_amount.rs:25:5
|
25 | s.write(b"test").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D unused-io-amount` implied by `-D warnings`
error: handle read amount returned or use `Read::read_exact` instead
- --> examples/unused_io_amount.rs:27:5
+ --> unused_io_amount.rs:27:5
|
27 | s.read(&mut buf).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: unused label `'label`
- --> examples/unused_labels.rs:8:5
+ --> unused_labels.rs:8:5
|
8 | / 'label: for i in 1..2 {
9 | | if i > 4 { continue }
= note: `-D unused-label` implied by `-D warnings`
error: unused label `'a`
- --> examples/unused_labels.rs:21:5
+ --> unused_labels.rs:21:5
|
21 | 'a: loop { break }
| ^^^^^^^^^^^^^^^^^^
= note: `-D unused-label` implied by `-D warnings`
error: unused label `'same_label_in_two_fns`
- --> examples/unused_labels.rs:32:5
+ --> unused_labels.rs:32:5
|
32 | / 'same_label_in_two_fns: loop {
33 | | let _ = 1;
error: this lifetime isn't used in the function definition
- --> examples/unused_lt.rs:16:14
+ --> unused_lt.rs:16:14
|
16 | fn unused_lt<'a>(x: u8) {
| ^^
= note: `-D unused-lifetimes` implied by `-D warnings`
error: this lifetime isn't used in the function definition
- --> examples/unused_lt.rs:20:25
+ --> unused_lt.rs:20:25
|
20 | fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) {
| ^^
= note: `-D unused-lifetimes` implied by `-D warnings`
error: this lifetime isn't used in the function definition
- --> examples/unused_lt.rs:50:10
+ --> unused_lt.rs:50:10
|
50 | fn x<'a>(&self) {}
| ^^
error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
- --> examples/used_underscore_binding.rs:17:5
+ --> used_underscore_binding.rs:17:5
|
17 | _foo + 1
| ^^^^
= note: `-D used-underscore-binding` implied by `-D warnings`
error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
- --> examples/used_underscore_binding.rs:22:20
+ --> used_underscore_binding.rs:22:20
|
22 | println!("{}", _foo);
| ^^^^
= note: `-D used-underscore-binding` implied by `-D warnings`
error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
- --> examples/used_underscore_binding.rs:23:16
+ --> used_underscore_binding.rs:23:16
|
23 | assert_eq!(_foo, _foo);
| ^^^^
= note: `-D used-underscore-binding` implied by `-D warnings`
error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
- --> examples/used_underscore_binding.rs:23:22
+ --> used_underscore_binding.rs:23:22
|
23 | assert_eq!(_foo, _foo);
| ^^^^
= note: `-D used-underscore-binding` implied by `-D warnings`
error: used binding `_underscore_field` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
- --> examples/used_underscore_binding.rs:36:5
+ --> used_underscore_binding.rs:36:5
|
36 | s._underscore_field += 1;
| ^^^^^^^^^^^^^^^^^^^
error[E0463]: can't find crate for `clippy_lints`
- --> examples/useless_attribute.rs:6:1
+ --> useless_attribute.rs:6:1
|
6 | extern crate clippy_lints;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
error: useless use of `vec!`
- --> examples/vec.rs:24:14
+ --> vec.rs:24:14
|
24 | on_slice(&vec![]);
| ^^^^^^^ help: you can use a slice directly `&[]`
= note: `-D useless-vec` implied by `-D warnings`
error: useless use of `vec!`
- --> examples/vec.rs:27:14
+ --> vec.rs:27:14
|
27 | on_slice(&vec![1, 2]);
| ^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]`
= note: `-D useless-vec` implied by `-D warnings`
error: useless use of `vec!`
- --> examples/vec.rs:30:14
+ --> vec.rs:30:14
|
30 | on_slice(&vec ![1, 2]);
| ^^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]`
= note: `-D useless-vec` implied by `-D warnings`
error: useless use of `vec!`
- --> examples/vec.rs:33:14
+ --> vec.rs:33:14
|
33 | on_slice(&vec!(1, 2));
| ^^^^^^^^^^^ help: you can use a slice directly `&[1, 2]`
= note: `-D useless-vec` implied by `-D warnings`
error: useless use of `vec!`
- --> examples/vec.rs:36:14
+ --> vec.rs:36:14
|
36 | on_slice(&vec![1; 2]);
| ^^^^^^^^^^^ help: you can use a slice directly `&[1; 2]`
= note: `-D useless-vec` implied by `-D warnings`
error: useless use of `vec!`
- --> examples/vec.rs:49:14
+ --> vec.rs:49:14
|
49 | for a in vec![1, 2, 3] {
| ^^^^^^^^^^^^^ help: you can use a slice directly `&[1, 2, 3]`
error: this loop could be written as a `while let` loop
- --> examples/while_loop.rs:9:5
+ --> while_loop.rs:9:5
|
9 | / loop {
10 | | if let Some(_x) = y {
= note: `-D while-let-loop` implied by `-D warnings`
error: this loop could be written as a `while let` loop
- --> examples/while_loop.rs:22:5
+ --> while_loop.rs:22:5
|
22 | / loop {
23 | | match y {
= note: `-D while-let-loop` implied by `-D warnings`
error: this loop could be written as a `while let` loop
- --> examples/while_loop.rs:28:5
+ --> while_loop.rs:28:5
|
28 | / loop {
29 | | let x = match y {
= note: `-D while-let-loop` implied by `-D warnings`
error: this loop could be written as a `while let` loop
- --> examples/while_loop.rs:36:5
+ --> while_loop.rs:36:5
|
36 | / loop {
37 | | let x = match y {
= note: `-D while-let-loop` implied by `-D warnings`
error: this loop could be written as a `while let` loop
- --> examples/while_loop.rs:58:5
+ --> while_loop.rs:58:5
|
58 | / loop {
59 | | let (e, l) = match "".split_whitespace().next() {
= note: `-D while-let-loop` implied by `-D warnings`
error: this loop could be written as a `for` loop
- --> examples/while_loop.rs:68:5
+ --> while_loop.rs:68:5
|
68 | / while let Option::Some(x) = iter.next() {
69 | | println!("{}", x);
= note: `-D while-let-on-iterator` implied by `-D warnings`
error: this loop could be written as a `for` loop
- --> examples/while_loop.rs:73:5
+ --> while_loop.rs:73:5
|
73 | / while let Some(x) = iter.next() {
74 | | println!("{}", x);
= note: `-D while-let-on-iterator` implied by `-D warnings`
error: this loop could be written as a `for` loop
- --> examples/while_loop.rs:78:5
+ --> while_loop.rs:78:5
|
78 | while let Some(_) = iter.next() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `for _ in iter { .. }`
= note: `-D while-let-on-iterator` implied by `-D warnings`
error: this loop could be written as a `while let` loop
- --> examples/while_loop.rs:118:5
+ --> while_loop.rs:118:5
|
118 | / loop {
119 | | let _ = match iter.next() {
= note: `-D while-let-loop` implied by `-D warnings`
error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body.
- --> examples/while_loop.rs:123:9
+ --> while_loop.rs:123:9
|
123 | loop {}
| ^^^^^^^
error: methods called `from_*` usually take no self; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:21:17
+ --> wrong_self_convention.rs:21:17
|
21 | fn from_i32(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `from_*` usually take no self; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:27:21
+ --> wrong_self_convention.rs:27:21
|
27 | pub fn from_i64(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `as_*` usually take self by reference or self by mutable reference; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:38:15
+ --> wrong_self_convention.rs:38:15
|
38 | fn as_i32(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:40:17
+ --> wrong_self_convention.rs:40:17
|
40 | fn into_i32(&self) {}
| ^^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `is_*` usually take self by reference or no self; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:42:15
+ --> wrong_self_convention.rs:42:15
|
42 | fn is_i32(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:44:15
+ --> wrong_self_convention.rs:44:15
|
44 | fn to_i32(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `from_*` usually take no self; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:46:17
+ --> wrong_self_convention.rs:46:17
|
46 | fn from_i32(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `as_*` usually take self by reference or self by mutable reference; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:48:19
+ --> wrong_self_convention.rs:48:19
|
48 | pub fn as_i64(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:49:21
+ --> wrong_self_convention.rs:49:21
|
49 | pub fn into_i64(&self) {}
| ^^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `is_*` usually take self by reference or no self; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:50:19
+ --> wrong_self_convention.rs:50:19
|
50 | pub fn is_i64(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:51:19
+ --> wrong_self_convention.rs:51:19
|
51 | pub fn to_i64(self) {}
| ^^^^
= note: `-D wrong-self-convention` implied by `-D warnings`
error: methods called `from_*` usually take no self; consider choosing a less ambiguous name
- --> examples/wrong_self_convention.rs:52:21
+ --> wrong_self_convention.rs:52:21
|
52 | pub fn from_i64(self) {}
| ^^^^
error: equal expressions as operands to `/`
- --> examples/zero_div_zero.rs:7:15
+ --> zero_div_zero.rs:7:15
|
7 | let nan = 0.0 / 0.0;
| ^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: constant division of 0.0 with 0.0 will always result in NaN
- --> examples/zero_div_zero.rs:7:15
+ --> zero_div_zero.rs:7:15
|
7 | let nan = 0.0 / 0.0;
| ^^^^^^^^^
= help: Consider using `std::f32::NAN` if you would like a constant representing NaN
error: equal expressions as operands to `/`
- --> examples/zero_div_zero.rs:8:19
+ --> zero_div_zero.rs:8:19
|
8 | let f64_nan = 0.0 / 0.0f64;
| ^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: constant division of 0.0 with 0.0 will always result in NaN
- --> examples/zero_div_zero.rs:8:19
+ --> zero_div_zero.rs:8:19
|
8 | let f64_nan = 0.0 / 0.0f64;
| ^^^^^^^^^^^^
= help: Consider using `std::f64::NAN` if you would like a constant representing NaN
error: equal expressions as operands to `/`
- --> examples/zero_div_zero.rs:9:25
+ --> zero_div_zero.rs:9:25
|
9 | let other_f64_nan = 0.0f64 / 0.0;
| ^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: constant division of 0.0 with 0.0 will always result in NaN
- --> examples/zero_div_zero.rs:9:25
+ --> zero_div_zero.rs:9:25
|
9 | let other_f64_nan = 0.0f64 / 0.0;
| ^^^^^^^^^^^^
= help: Consider using `std::f64::NAN` if you would like a constant representing NaN
error: equal expressions as operands to `/`
- --> examples/zero_div_zero.rs:10:28
+ --> zero_div_zero.rs:10:28
|
10 | let one_more_f64_nan = 0.0f64/0.0f64;
| ^^^^^^^^^^^^^
= note: `-D eq-op` implied by `-D warnings`
error: constant division of 0.0 with 0.0 will always result in NaN
- --> examples/zero_div_zero.rs:10:28
+ --> zero_div_zero.rs:10:28
|
10 | let one_more_f64_nan = 0.0f64/0.0f64;
| ^^^^^^^^^^^^^
error: `0 as *const _` detected. Consider using `ptr::null()`
- --> examples/zero_ptr.rs:6:13
+ --> zero_ptr.rs:6:13
|
6 | let x = 0 as *const usize;
| ^^^^^^^^^^^^^^^^^
= note: `-D zero-ptr` implied by `-D warnings`
error: `0 as *mut _` detected. Consider using `ptr::null_mut()`
- --> examples/zero_ptr.rs:7:13
+ --> zero_ptr.rs:7:13
|
7 | let y = 0 as *mut f64;
| ^^^^^^^^^^^^^
extern crate duct;
#[test]
-fn compile_test() {
+fn examples() {
let mut error = false;
for file in std::fs::read_dir("clippy_tests/examples").unwrap() {
let file = file.unwrap().path();
}
cmd!("touch", &file).run().unwrap();
let output = file.with_extension("stderr");
- cmd!("cargo", "rustc", "-q", "--example", file.file_stem().unwrap(), "--", "-Dwarnings")
+ cmd!("cargo", "rustc", "-q", "--example", file.file_stem().unwrap(), "--", "-Dwarnings",
+ "-Zremap-path-prefix-from=examples/", "-Zremap-path-prefix-to=",
+ "-Zremap-path-prefix-from=examples\\", "-Zremap-path-prefix-to="
+ )
.unchecked()
.stderr(&output)
.env("CLIPPY_DISABLE_WIKI_LINKS", "true")