mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-26 22:50:56 +00:00
Adapt the *.stderr files of the ui-tests to the tool_lints
This commit is contained in:
parent
1b6f6051a8
commit
e9af09c274
194 changed files with 2421 additions and 2421 deletions
|
@ -4,7 +4,7 @@ error: this comparison involving the minimum or maximum element for this type co
|
|||
10 | u <= 0;
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `-D absurd-extreme-comparisons` implied by `-D warnings`
|
||||
= note: `-D clippy::absurd-extreme-comparisons` implied by `-D warnings`
|
||||
= 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
|
||||
|
@ -141,7 +141,7 @@ error: <-comparison of unit values detected. This will always be false
|
|||
31 | () < {};
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: #[deny(unit_cmp)] on by default
|
||||
= note: #[deny(clippy::unit_cmp)] on by default
|
||||
|
||||
error: aborting due to 18 previous errors
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ error: approximate value of `f{32, 64}::consts::E` found. Consider using it dire
|
|||
7 | let my_e = 2.7182;
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `-D approx-constant` implied by `-D warnings`
|
||||
= note: `-D clippy::approx-constant` implied by `-D warnings`
|
||||
|
||||
error: approximate value of `f{32, 64}::consts::E` found. Consider using it directly
|
||||
--> $DIR/approx_const.rs:8:20
|
||||
|
|
|
@ -4,7 +4,7 @@ error: integer arithmetic detected
|
|||
8 | 1 + i;
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `-D integer-arithmetic` implied by `-D warnings`
|
||||
= note: `-D clippy::integer-arithmetic` implied by `-D warnings`
|
||||
|
||||
error: integer arithmetic detected
|
||||
--> $DIR/arithmetic.rs:9:5
|
||||
|
@ -37,7 +37,7 @@ error: floating-point arithmetic detected
|
|||
23 | f * 2.0;
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: `-D float-arithmetic` implied by `-D warnings`
|
||||
= note: `-D clippy::float-arithmetic` implied by `-D warnings`
|
||||
|
||||
error: floating-point arithmetic detected
|
||||
--> $DIR/arithmetic.rs:25:5
|
||||
|
|
|
@ -1,57 +1,57 @@
|
|||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:5:5
|
||||
|
|
||||
5 | 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
|
||||
--> $DIR/assign_ops.rs:6:5
|
||||
|
|
||||
6 | a = 1 + a;
|
||||
| ^^^^^^^^^ help: replace it with: `a += 1`
|
||||
|
||||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:7:5
|
||||
|
|
||||
7 | a = a - 1;
|
||||
| ^^^^^^^^^ help: replace it with: `a -= 1`
|
||||
7 | a = a + 1;
|
||||
| ^^^^^^^^^ help: replace it with: `a += 1`
|
||||
|
|
||||
= note: `-D clippy::assign-op-pattern` implied by `-D warnings`
|
||||
|
||||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:8:5
|
||||
|
|
||||
8 | a = a * 99;
|
||||
| ^^^^^^^^^^ help: replace it with: `a *= 99`
|
||||
8 | a = 1 + a;
|
||||
| ^^^^^^^^^ help: replace it with: `a += 1`
|
||||
|
||||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:9:5
|
||||
|
|
||||
9 | a = 42 * a;
|
||||
| ^^^^^^^^^^ help: replace it with: `a *= 42`
|
||||
9 | a = a - 1;
|
||||
| ^^^^^^^^^ help: replace it with: `a -= 1`
|
||||
|
||||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:10:5
|
||||
|
|
||||
10 | a = a / 2;
|
||||
| ^^^^^^^^^ help: replace it with: `a /= 2`
|
||||
10 | a = a * 99;
|
||||
| ^^^^^^^^^^ help: replace it with: `a *= 99`
|
||||
|
||||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:11:5
|
||||
|
|
||||
11 | a = a % 5;
|
||||
| ^^^^^^^^^ help: replace it with: `a %= 5`
|
||||
11 | a = 42 * a;
|
||||
| ^^^^^^^^^^ help: replace it with: `a *= 42`
|
||||
|
||||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:12:5
|
||||
|
|
||||
12 | a = a & 1;
|
||||
12 | a = a / 2;
|
||||
| ^^^^^^^^^ help: replace it with: `a /= 2`
|
||||
|
||||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:13:5
|
||||
|
|
||||
13 | a = a % 5;
|
||||
| ^^^^^^^^^ help: replace it with: `a %= 5`
|
||||
|
||||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:14:5
|
||||
|
|
||||
14 | a = a & 1;
|
||||
| ^^^^^^^^^ help: replace it with: `a &= 1`
|
||||
|
||||
error: manual implementation of an assign operation
|
||||
--> $DIR/assign_ops.rs:18:5
|
||||
--> $DIR/assign_ops.rs:20:5
|
||||
|
|
||||
18 | s = s + "bla";
|
||||
20 | s = s + "bla";
|
||||
| ^^^^^^^^^^^^^ help: replace it with: `s += "bla"`
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: variable appears on both sides of an assignment operation
|
|||
8 | a += a + 1;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `-D misrefactored-assign-op` implied by `-D warnings`
|
||||
= note: `-D clippy::misrefactored-assign-op` implied by `-D warnings`
|
||||
help: Did you mean a = a + 1 or a = a + a + 1? Consider replacing it with
|
||||
|
|
||||
8 | a += 1;
|
||||
|
|
|
@ -4,7 +4,7 @@ error: you have declared `#[inline(always)]` on `test_attr_lint`. This is usuall
|
|||
6 | #[inline(always)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D inline-always` implied by `-D warnings`
|
||||
= note: `-D clippy::inline-always` implied by `-D warnings`
|
||||
|
||||
error: the since field must contain a semver-compliant version
|
||||
--> $DIR/attrs.rs:27:14
|
||||
|
@ -12,7 +12,7 @@ error: the since field must contain a semver-compliant version
|
|||
27 | #[deprecated(since = "forever")]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D deprecated-semver` implied by `-D warnings`
|
||||
= note: `-D clippy::deprecated-semver` implied by `-D warnings`
|
||||
|
||||
error: the since field must contain a semver-compliant version
|
||||
--> $DIR/attrs.rs:30:14
|
||||
|
|
|
@ -4,7 +4,7 @@ error: returning the result of a let binding from a block. Consider returning th
|
|||
9 | x
|
||||
| ^
|
||||
|
|
||||
= note: `-D let-and-return` implied by `-D warnings`
|
||||
= note: `-D clippy::let-and-return` implied by `-D warnings`
|
||||
note: this expression can be directly returned
|
||||
--> $DIR/matches.rs:8:21
|
||||
|
|
||||
|
|
|
@ -4,7 +4,7 @@ error: &-masking with zero
|
|||
12 | x & 0 == 0;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `-D bad-bit-mask` implied by `-D warnings`
|
||||
= note: `-D clippy::bad-bit-mask` implied by `-D warnings`
|
||||
|
||||
error: this operation will always return zero. This is likely not the intended outcome
|
||||
--> $DIR/bit_masks.rs:12:5
|
||||
|
@ -12,7 +12,7 @@ error: this operation will always return zero. This is likely not the intended o
|
|||
12 | x & 0 == 0;
|
||||
| ^^^^^
|
||||
|
|
||||
= note: #[deny(erasing_op)] on by default
|
||||
= note: #[deny(clippy::erasing_op)] on by default
|
||||
|
||||
error: incompatible bit mask: `_ & 2` can never be equal to `1`
|
||||
--> $DIR/bit_masks.rs:15:5
|
||||
|
@ -86,7 +86,7 @@ error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared
|
|||
52 | x | 1 > 3;
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: `-D ineffective-bit-mask` implied by `-D warnings`
|
||||
= note: `-D clippy::ineffective-bit-mask` implied by `-D warnings`
|
||||
|
||||
error: ineffective bit mask: `x | 1` compared to `4`, is the same as x compared directly
|
||||
--> $DIR/bit_masks.rs:53:5
|
||||
|
|
|
@ -4,7 +4,7 @@ error: use of a blacklisted/placeholder name `foo`
|
|||
7 | fn test(foo: ()) {}
|
||||
| ^^^
|
||||
|
|
||||
= note: `-D blacklisted-name` implied by `-D warnings`
|
||||
= note: `-D clippy::blacklisted-name` implied by `-D warnings`
|
||||
|
||||
error: use of a blacklisted/placeholder name `foo`
|
||||
--> $DIR/blacklisted_name.rs:10:9
|
||||
|
|
|
@ -8,7 +8,7 @@ error: in an 'if' condition, avoid complex blocks or closures with blocks; inste
|
|||
33 | | } {
|
||||
| |_____^
|
||||
|
|
||||
= note: `-D block-in-if-condition-stmt` implied by `-D warnings`
|
||||
= note: `-D clippy::block-in-if-condition-stmt` implied by `-D warnings`
|
||||
= help: try
|
||||
let res = {
|
||||
let x = 3;
|
||||
|
@ -24,7 +24,7 @@ error: omit braces around single expression condition
|
|||
41 | if { true } {
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: `-D block-in-if-condition-expr` implied by `-D warnings`
|
||||
= note: `-D clippy::block-in-if-condition-expr` implied by `-D warnings`
|
||||
= help: try
|
||||
if true {
|
||||
6
|
||||
|
@ -48,7 +48,7 @@ error: this boolean expression can be simplified
|
|||
67 | if true && x == 3 {
|
||||
| ^^^^^^^^^^^^^^ help: try: `x == 3`
|
||||
|
|
||||
= note: `-D nonminimal-bool` implied by `-D warnings`
|
||||
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ error: equality checks against true are unnecessary
|
|||
7 | if x == true { "yes" } else { "no" };
|
||||
| ^^^^^^^^^ help: try simplifying it as shown: `x`
|
||||
|
|
||||
= note: `-D bool-comparison` implied by `-D warnings`
|
||||
= note: `-D clippy::bool-comparison` implied by `-D warnings`
|
||||
|
||||
error: equality checks against false can be replaced by a negation
|
||||
--> $DIR/bool_comparison.rs:8:8
|
||||
|
|
|
@ -4,7 +4,7 @@ error: this boolean expression contains a logic bug
|
|||
12 | let _ = a && b || a;
|
||||
| ^^^^^^^^^^^ help: it would look like the following: `a`
|
||||
|
|
||||
= note: `-D logic-bug` implied by `-D warnings`
|
||||
= note: `-D clippy::logic-bug` implied by `-D warnings`
|
||||
help: this expression can be optimized out by applying boolean operations to the outer expression
|
||||
--> $DIR/booleans.rs:12:18
|
||||
|
|
||||
|
@ -17,7 +17,7 @@ error: this boolean expression can be simplified
|
|||
14 | let _ = !true;
|
||||
| ^^^^^ help: try: `false`
|
||||
|
|
||||
= note: `-D nonminimal-bool` implied by `-D warnings`
|
||||
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
|
||||
|
||||
error: this boolean expression can be simplified
|
||||
--> $DIR/booleans.rs:15:13
|
||||
|
|
|
@ -7,8 +7,8 @@ error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
|
|||
note: lint level defined here
|
||||
--> $DIR/borrow_box.rs:4:9
|
||||
|
|
||||
4 | #![deny(borrowed_box)]
|
||||
| ^^^^^^^^^^^^
|
||||
4 | #![deny(clippy::borrowed_box)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
|
||||
--> $DIR/borrow_box.rs:14:14
|
||||
|
|
|
@ -4,7 +4,7 @@ error: you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`
|
|||
17 | pub fn test(foo: Box<Vec<bool>>) {
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D box-vec` implied by `-D warnings`
|
||||
= note: `-D clippy::box-vec` implied by `-D warnings`
|
||||
= help: `Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation.
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
@ -4,7 +4,7 @@ error: This generic shadows the built-in type `u32`
|
|||
5 | fn foo<u32>(a: u32) -> u32 {
|
||||
| ^^^
|
||||
|
|
||||
= note: `-D builtin-type-shadow` implied by `-D warnings`
|
||||
= note: `-D clippy::builtin-type-shadow` implied by `-D warnings`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/builtin-type-shadow.rs:6:5
|
||||
|
|
|
@ -7,8 +7,8 @@ error: You appear to be counting bytes the naive way
|
|||
note: lint level defined here
|
||||
--> $DIR/bytecount.rs:4:8
|
||||
|
|
||||
4 | #[deny(naive_bytecount)]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
4 | #[deny(clippy::naive_bytecount)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: You appear to be counting bytes the naive way
|
||||
--> $DIR/bytecount.rs:10:13
|
||||
|
|
|
@ -4,7 +4,7 @@ error: casting i32 to f32 causes a loss of precision (i32 is 32 bits wide, but f
|
|||
8 | 1i32 as f32;
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D cast-precision-loss` implied by `-D warnings`
|
||||
= note: `-D clippy::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)
|
||||
--> $DIR/cast.rs:9:5
|
||||
|
@ -42,7 +42,7 @@ error: casting f32 to i32 may truncate the value
|
|||
15 | 1f32 as i32;
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D cast-possible-truncation` implied by `-D warnings`
|
||||
= note: `-D clippy::cast-possible-truncation` implied by `-D warnings`
|
||||
|
||||
error: casting f32 to u32 may truncate the value
|
||||
--> $DIR/cast.rs:16:5
|
||||
|
@ -56,7 +56,7 @@ error: casting f32 to u32 may lose the sign of the value
|
|||
16 | 1f32 as u32;
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D cast-sign-loss` implied by `-D warnings`
|
||||
= note: `-D clippy::cast-sign-loss` implied by `-D warnings`
|
||||
|
||||
error: casting f64 to f32 may truncate the value
|
||||
--> $DIR/cast.rs:17:5
|
||||
|
@ -106,7 +106,7 @@ error: casting u8 to i8 may wrap around the value
|
|||
23 | 1u8 as i8;
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: `-D cast-possible-wrap` implied by `-D warnings`
|
||||
= note: `-D clippy::cast-possible-wrap` implied by `-D warnings`
|
||||
|
||||
error: casting u16 to i16 may wrap around the value
|
||||
--> $DIR/cast.rs:24:5
|
||||
|
@ -138,7 +138,7 @@ error: casting f32 to f64 may become silently lossy if types change
|
|||
29 | 1.0f32 as f64;
|
||||
| ^^^^^^^^^^^^^ help: try: `f64::from(1.0f32)`
|
||||
|
|
||||
= note: `-D cast-lossless` implied by `-D warnings`
|
||||
= note: `-D clippy::cast-lossless` implied by `-D warnings`
|
||||
|
||||
error: casting u8 to u16 may become silently lossy if types change
|
||||
--> $DIR/cast.rs:31:5
|
||||
|
@ -164,7 +164,7 @@ error: casting to the same type is unnecessary (`i32` -> `i32`)
|
|||
37 | 1i32 as i32;
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D unnecessary-cast` implied by `-D warnings`
|
||||
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
|
||||
|
||||
error: casting to the same type is unnecessary (`f32` -> `f32`)
|
||||
--> $DIR/cast.rs:38:5
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
error: casting from `*const u8` to a more-strictly-aligned pointer (`*const u16`)
|
||||
--> $DIR/cast_alignment.rs:13:5
|
||||
--> $DIR/cast_alignment.rs:15:5
|
||||
|
|
||||
13 | (&1u8 as *const u8) as *const u16;
|
||||
15 | (&1u8 as *const u8) as *const u16;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D cast-ptr-alignment` implied by `-D warnings`
|
||||
= note: `-D clippy::cast-ptr-alignment` implied by `-D warnings`
|
||||
|
||||
error: casting from `*mut u8` to a more-strictly-aligned pointer (`*mut u16`)
|
||||
--> $DIR/cast_alignment.rs:14:5
|
||||
--> $DIR/cast_alignment.rs:16:5
|
||||
|
|
||||
14 | (&mut 1u8 as *mut u8) as *mut u16;
|
||||
16 | (&mut 1u8 as *mut u8) as *mut u16;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
|
|
@ -1,63 +1,63 @@
|
|||
error: casting i8 to f32 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:5:5
|
||||
--> $DIR/cast_lossless_float.rs:7:5
|
||||
|
|
||||
5 | 1i8 as f32;
|
||||
7 | 1i8 as f32;
|
||||
| ^^^^^^^^^^ help: try: `f32::from(1i8)`
|
||||
|
|
||||
= note: `-D cast-lossless` implied by `-D warnings`
|
||||
= note: `-D clippy::cast-lossless` implied by `-D warnings`
|
||||
|
||||
error: casting i8 to f64 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:6:5
|
||||
--> $DIR/cast_lossless_float.rs:8:5
|
||||
|
|
||||
6 | 1i8 as f64;
|
||||
8 | 1i8 as f64;
|
||||
| ^^^^^^^^^^ help: try: `f64::from(1i8)`
|
||||
|
||||
error: casting u8 to f32 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:7:5
|
||||
--> $DIR/cast_lossless_float.rs:9:5
|
||||
|
|
||||
7 | 1u8 as f32;
|
||||
9 | 1u8 as f32;
|
||||
| ^^^^^^^^^^ help: try: `f32::from(1u8)`
|
||||
|
||||
error: casting u8 to f64 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:8:5
|
||||
|
|
||||
8 | 1u8 as f64;
|
||||
| ^^^^^^^^^^ help: try: `f64::from(1u8)`
|
||||
|
||||
error: casting i16 to f32 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:9:5
|
||||
|
|
||||
9 | 1i16 as f32;
|
||||
| ^^^^^^^^^^^ help: try: `f32::from(1i16)`
|
||||
|
||||
error: casting i16 to f64 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:10:5
|
||||
|
|
||||
10 | 1i16 as f64;
|
||||
10 | 1u8 as f64;
|
||||
| ^^^^^^^^^^ help: try: `f64::from(1u8)`
|
||||
|
||||
error: casting i16 to f32 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:11:5
|
||||
|
|
||||
11 | 1i16 as f32;
|
||||
| ^^^^^^^^^^^ help: try: `f32::from(1i16)`
|
||||
|
||||
error: casting i16 to f64 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:12:5
|
||||
|
|
||||
12 | 1i16 as f64;
|
||||
| ^^^^^^^^^^^ help: try: `f64::from(1i16)`
|
||||
|
||||
error: casting u16 to f32 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:11:5
|
||||
--> $DIR/cast_lossless_float.rs:13:5
|
||||
|
|
||||
11 | 1u16 as f32;
|
||||
13 | 1u16 as f32;
|
||||
| ^^^^^^^^^^^ help: try: `f32::from(1u16)`
|
||||
|
||||
error: casting u16 to f64 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:12:5
|
||||
--> $DIR/cast_lossless_float.rs:14:5
|
||||
|
|
||||
12 | 1u16 as f64;
|
||||
14 | 1u16 as f64;
|
||||
| ^^^^^^^^^^^ help: try: `f64::from(1u16)`
|
||||
|
||||
error: casting i32 to f64 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:13:5
|
||||
--> $DIR/cast_lossless_float.rs:15:5
|
||||
|
|
||||
13 | 1i32 as f64;
|
||||
15 | 1i32 as f64;
|
||||
| ^^^^^^^^^^^ help: try: `f64::from(1i32)`
|
||||
|
||||
error: casting u32 to f64 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_float.rs:14:5
|
||||
--> $DIR/cast_lossless_float.rs:16:5
|
||||
|
|
||||
14 | 1u32 as f64;
|
||||
16 | 1u32 as f64;
|
||||
| ^^^^^^^^^^^ help: try: `f64::from(1u32)`
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: casting i8 to i16 may become silently lossy if types change
|
|||
6 | 1i8 as i16;
|
||||
| ^^^^^^^^^^ help: try: `i16::from(1i8)`
|
||||
|
|
||||
= note: `-D cast-lossless` implied by `-D warnings`
|
||||
= note: `-D clippy::cast-lossless` implied by `-D warnings`
|
||||
|
||||
error: casting i8 to i32 may become silently lossy if types change
|
||||
--> $DIR/cast_lossless_integer.rs:7:5
|
||||
|
|
|
@ -1,123 +1,123 @@
|
|||
error: casting isize to i8 may truncate the value
|
||||
--> $DIR/cast_size.rs:5:5
|
||||
|
|
||||
5 | 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)
|
||||
--> $DIR/cast_size.rs:6:5
|
||||
|
|
||||
6 | 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)
|
||||
--> $DIR/cast_size.rs:7:5
|
||||
|
|
||||
7 | 1usize as f64;
|
||||
7 | 1isize as i8;
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::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)
|
||||
--> $DIR/cast_size.rs:8:5
|
||||
|
|
||||
8 | 1isize as f64;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::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)
|
||||
--> $DIR/cast_size.rs:9:5
|
||||
|
|
||||
9 | 1usize as f64;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting isize to f32 causes a loss of precision (isize is 32 or 64 bits wide, but f32's mantissa is only 23 bits wide)
|
||||
--> $DIR/cast_size.rs:8:5
|
||||
|
|
||||
8 | 1isize as f32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting usize to f32 causes a loss of precision (usize is 32 or 64 bits wide, but f32's mantissa is only 23 bits wide)
|
||||
--> $DIR/cast_size.rs:9:5
|
||||
|
|
||||
9 | 1usize as f32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting isize to i32 may truncate the value on targets with 64-bit wide pointers
|
||||
--> $DIR/cast_size.rs:10:5
|
||||
|
|
||||
10 | 1isize as i32;
|
||||
10 | 1isize as f32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting usize to f32 causes a loss of precision (usize is 32 or 64 bits wide, but f32's mantissa is only 23 bits wide)
|
||||
--> $DIR/cast_size.rs:11:5
|
||||
|
|
||||
11 | 1usize as f32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting isize to i32 may truncate the value on targets with 64-bit wide pointers
|
||||
--> $DIR/cast_size.rs:12:5
|
||||
|
|
||||
12 | 1isize as i32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting isize to u32 may lose the sign of the value
|
||||
--> $DIR/cast_size.rs:11:5
|
||||
--> $DIR/cast_size.rs:13:5
|
||||
|
|
||||
11 | 1isize as u32;
|
||||
13 | 1isize as u32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D cast-sign-loss` implied by `-D warnings`
|
||||
= note: `-D clippy::cast-sign-loss` implied by `-D warnings`
|
||||
|
||||
error: casting isize to u32 may truncate the value on targets with 64-bit wide pointers
|
||||
--> $DIR/cast_size.rs:11:5
|
||||
--> $DIR/cast_size.rs:13:5
|
||||
|
|
||||
11 | 1isize as u32;
|
||||
13 | 1isize as u32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting usize to u32 may truncate the value on targets with 64-bit wide pointers
|
||||
--> $DIR/cast_size.rs:12:5
|
||||
--> $DIR/cast_size.rs:14:5
|
||||
|
|
||||
12 | 1usize as u32;
|
||||
14 | 1usize as u32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting usize to i32 may truncate the value on targets with 64-bit wide pointers
|
||||
--> $DIR/cast_size.rs:13:5
|
||||
--> $DIR/cast_size.rs:15:5
|
||||
|
|
||||
13 | 1usize as i32;
|
||||
15 | 1usize as i32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting usize to i32 may wrap around the value on targets with 32-bit wide pointers
|
||||
--> $DIR/cast_size.rs:13:5
|
||||
|
|
||||
13 | 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
|
||||
--> $DIR/cast_size.rs:15:5
|
||||
|
|
||||
15 | 1i64 as isize;
|
||||
15 | 1usize as i32;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::cast-possible-wrap` implied by `-D warnings`
|
||||
|
||||
error: casting i64 to isize may truncate the value on targets with 32-bit wide pointers
|
||||
--> $DIR/cast_size.rs:17:5
|
||||
|
|
||||
17 | 1i64 as isize;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting i64 to usize may lose the sign of the value
|
||||
--> $DIR/cast_size.rs:16:5
|
||||
--> $DIR/cast_size.rs:18:5
|
||||
|
|
||||
16 | 1i64 as usize;
|
||||
18 | 1i64 as usize;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting i64 to usize may truncate the value on targets with 32-bit wide pointers
|
||||
--> $DIR/cast_size.rs:16:5
|
||||
--> $DIR/cast_size.rs:18:5
|
||||
|
|
||||
16 | 1i64 as usize;
|
||||
18 | 1i64 as usize;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting u64 to isize may truncate the value on targets with 32-bit wide pointers
|
||||
--> $DIR/cast_size.rs:17:5
|
||||
--> $DIR/cast_size.rs:19:5
|
||||
|
|
||||
17 | 1u64 as isize;
|
||||
19 | 1u64 as isize;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting u64 to isize may wrap around the value on targets with 64-bit wide pointers
|
||||
--> $DIR/cast_size.rs:17:5
|
||||
--> $DIR/cast_size.rs:19:5
|
||||
|
|
||||
17 | 1u64 as isize;
|
||||
19 | 1u64 as isize;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting u64 to usize may truncate the value on targets with 32-bit wide pointers
|
||||
--> $DIR/cast_size.rs:18:5
|
||||
--> $DIR/cast_size.rs:20:5
|
||||
|
|
||||
18 | 1u64 as usize;
|
||||
20 | 1u64 as usize;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting u32 to isize may wrap around the value on targets with 32-bit wide pointers
|
||||
--> $DIR/cast_size.rs:19:5
|
||||
--> $DIR/cast_size.rs:21:5
|
||||
|
|
||||
19 | 1u32 as isize;
|
||||
21 | 1u32 as isize;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: casting i32 to usize may lose the sign of the value
|
||||
--> $DIR/cast_size.rs:22:5
|
||||
--> $DIR/cast_size.rs:24:5
|
||||
|
|
||||
22 | 1i32 as usize;
|
||||
24 | 1i32 as usize;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 19 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: casting character literal to u8. `char`s are 4 bytes wide in rust, so cas
|
|||
7 | let c = 'a' as u8;
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: `-D char-lit-as-u8` implied by `-D warnings`
|
||||
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
|
||||
= help: Consider using a byte literal instead:
|
||||
b'a'
|
||||
|
||||
|
|
|
@ -1,313 +1,313 @@
|
|||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:7:9
|
||||
|
|
||||
6 | if x.is_some() {
|
||||
| ----------- the check is happening here
|
||||
7 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/checked_unwrap.rs:1:27
|
||||
|
|
||||
1 | #![deny(panicking_unwrap, unnecessary_unwrap)]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:9:9
|
||||
|
|
||||
6 | if x.is_some() {
|
||||
| ----------- because of this check
|
||||
...
|
||||
9 | x.unwrap(); // will panic
|
||||
8 | if x.is_some() {
|
||||
| ----------- the check is happening here
|
||||
9 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/checked_unwrap.rs:1:9
|
||||
--> $DIR/checked_unwrap.rs:3:35
|
||||
|
|
||||
1 | #![deny(panicking_unwrap, unnecessary_unwrap)]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
3 | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:12:9
|
||||
--> $DIR/checked_unwrap.rs:11:9
|
||||
|
|
||||
11 | if x.is_none() {
|
||||
8 | if x.is_some() {
|
||||
| ----------- because of this check
|
||||
12 | x.unwrap(); // will panic
|
||||
...
|
||||
11 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/checked_unwrap.rs:3:9
|
||||
|
|
||||
3 | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:14:9
|
||||
|
|
||||
11 | if x.is_none() {
|
||||
13 | if x.is_none() {
|
||||
| ----------- because of this check
|
||||
14 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:16:9
|
||||
|
|
||||
13 | if x.is_none() {
|
||||
| ----------- the check is happening here
|
||||
...
|
||||
14 | x.unwrap(); // unnecessary
|
||||
16 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:18:9
|
||||
--> $DIR/checked_unwrap.rs:20:9
|
||||
|
|
||||
17 | if x.is_ok() {
|
||||
19 | if x.is_ok() {
|
||||
| --------- the check is happening here
|
||||
18 | x.unwrap(); // unnecessary
|
||||
20 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:19:9
|
||||
|
|
||||
17 | if x.is_ok() {
|
||||
| --------- because of this check
|
||||
18 | x.unwrap(); // unnecessary
|
||||
19 | x.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:21:9
|
||||
|
|
||||
17 | if x.is_ok() {
|
||||
19 | if x.is_ok() {
|
||||
| --------- because of this check
|
||||
...
|
||||
21 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:22:9
|
||||
|
|
||||
17 | if x.is_ok() {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
22 | x.unwrap_err(); // unnecessary
|
||||
20 | x.unwrap(); // unnecessary
|
||||
21 | x.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:25:9
|
||||
--> $DIR/checked_unwrap.rs:23:9
|
||||
|
|
||||
24 | if x.is_err() {
|
||||
| ---------- because of this check
|
||||
25 | x.unwrap(); // will panic
|
||||
19 | if x.is_ok() {
|
||||
| --------- because of this check
|
||||
...
|
||||
23 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:26:9
|
||||
--> $DIR/checked_unwrap.rs:24:9
|
||||
|
|
||||
24 | if x.is_err() {
|
||||
| ---------- the check is happening here
|
||||
25 | x.unwrap(); // will panic
|
||||
26 | x.unwrap_err(); // unnecessary
|
||||
19 | if x.is_ok() {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
24 | x.unwrap_err(); // unnecessary
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:27:9
|
||||
|
|
||||
26 | if x.is_err() {
|
||||
| ---------- because of this check
|
||||
27 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:28:9
|
||||
|
|
||||
24 | if x.is_err() {
|
||||
26 | if x.is_err() {
|
||||
| ---------- the check is happening here
|
||||
...
|
||||
28 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:29:9
|
||||
|
|
||||
24 | if x.is_err() {
|
||||
| ---------- because of this check
|
||||
...
|
||||
29 | x.unwrap_err(); // will panic
|
||||
27 | x.unwrap(); // will panic
|
||||
28 | x.unwrap_err(); // unnecessary
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:46:9
|
||||
--> $DIR/checked_unwrap.rs:30:9
|
||||
|
|
||||
45 | if x.is_ok() && y.is_err() {
|
||||
| --------- the check is happening here
|
||||
46 | x.unwrap(); // unnecessary
|
||||
26 | if x.is_err() {
|
||||
| ---------- the check is happening here
|
||||
...
|
||||
30 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:47:9
|
||||
--> $DIR/checked_unwrap.rs:31:9
|
||||
|
|
||||
45 | if x.is_ok() && y.is_err() {
|
||||
| --------- because of this check
|
||||
46 | x.unwrap(); // unnecessary
|
||||
47 | x.unwrap_err(); // will panic
|
||||
26 | if x.is_err() {
|
||||
| ---------- because of this check
|
||||
...
|
||||
31 | x.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:48:9
|
||||
|
|
||||
45 | if x.is_ok() && y.is_err() {
|
||||
| ---------- because of this check
|
||||
...
|
||||
48 | y.unwrap(); // will panic
|
||||
47 | if x.is_ok() && y.is_err() {
|
||||
| --------- the check is happening here
|
||||
48 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:49:9
|
||||
|
|
||||
45 | if x.is_ok() && y.is_err() {
|
||||
| ---------- the check is happening here
|
||||
...
|
||||
49 | y.unwrap_err(); // unnecessary
|
||||
47 | if x.is_ok() && y.is_err() {
|
||||
| --------- because of this check
|
||||
48 | x.unwrap(); // unnecessary
|
||||
49 | x.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:63:9
|
||||
--> $DIR/checked_unwrap.rs:50:9
|
||||
|
|
||||
58 | if x.is_ok() || y.is_ok() {
|
||||
| --------- because of this check
|
||||
47 | if x.is_ok() && y.is_err() {
|
||||
| ---------- because of this check
|
||||
...
|
||||
63 | x.unwrap(); // will panic
|
||||
50 | y.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:64:9
|
||||
--> $DIR/checked_unwrap.rs:51:9
|
||||
|
|
||||
58 | if x.is_ok() || y.is_ok() {
|
||||
| --------- the check is happening here
|
||||
47 | if x.is_ok() && y.is_err() {
|
||||
| ---------- the check is happening here
|
||||
...
|
||||
64 | x.unwrap_err(); // unnecessary
|
||||
51 | y.unwrap_err(); // unnecessary
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:65:9
|
||||
|
|
||||
58 | if x.is_ok() || y.is_ok() {
|
||||
| --------- because of this check
|
||||
60 | if x.is_ok() || y.is_ok() {
|
||||
| --------- because of this check
|
||||
...
|
||||
65 | y.unwrap(); // will panic
|
||||
65 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:66:9
|
||||
|
|
||||
58 | if x.is_ok() || y.is_ok() {
|
||||
60 | if x.is_ok() || y.is_ok() {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
66 | x.unwrap_err(); // unnecessary
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:67:9
|
||||
|
|
||||
60 | if x.is_ok() || y.is_ok() {
|
||||
| --------- because of this check
|
||||
...
|
||||
67 | y.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:68:9
|
||||
|
|
||||
60 | if x.is_ok() || y.is_ok() {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
66 | y.unwrap_err(); // unnecessary
|
||||
68 | y.unwrap_err(); // unnecessary
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:70:9
|
||||
|
|
||||
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| --------- the check is happening here
|
||||
70 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:71:9
|
||||
|
|
||||
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| --------- because of this check
|
||||
70 | x.unwrap(); // unnecessary
|
||||
71 | x.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:72:9
|
||||
|
|
||||
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| --------- because of this check
|
||||
...
|
||||
72 | y.unwrap(); // will panic
|
||||
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| --------- the check is happening here
|
||||
72 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:73:9
|
||||
|
|
||||
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
73 | y.unwrap_err(); // unnecessary
|
||||
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| --------- because of this check
|
||||
72 | x.unwrap(); // unnecessary
|
||||
73 | x.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:74:9
|
||||
|
|
||||
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| ---------- the check is happening here
|
||||
...
|
||||
74 | z.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:75:9
|
||||
|
|
||||
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| ---------- because of this check
|
||||
...
|
||||
75 | z.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:83:9
|
||||
|
|
||||
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| --------- because of this check
|
||||
...
|
||||
83 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:84:9
|
||||
|
|
||||
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
84 | x.unwrap_err(); // unnecessary
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:85:9
|
||||
|
|
||||
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
85 | y.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:86:9
|
||||
|
|
||||
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| --------- because of this check
|
||||
...
|
||||
86 | y.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:87:9
|
||||
|
|
||||
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| ---------- because of this check
|
||||
...
|
||||
87 | z.unwrap(); // will panic
|
||||
74 | y.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:88:9
|
||||
--> $DIR/checked_unwrap.rs:75:9
|
||||
|
|
||||
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| ---------- the check is happening here
|
||||
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
88 | z.unwrap_err(); // unnecessary
|
||||
75 | y.unwrap_err(); // unnecessary
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:96:13
|
||||
--> $DIR/checked_unwrap.rs:76:9
|
||||
|
|
||||
95 | if x.is_some() {
|
||||
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| ---------- the check is happening here
|
||||
...
|
||||
76 | z.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:77:9
|
||||
|
|
||||
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
||||
| ---------- because of this check
|
||||
...
|
||||
77 | z.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:85:9
|
||||
|
|
||||
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| --------- because of this check
|
||||
...
|
||||
85 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:86:9
|
||||
|
|
||||
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
86 | x.unwrap_err(); // unnecessary
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:87:9
|
||||
|
|
||||
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| --------- the check is happening here
|
||||
...
|
||||
87 | y.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap_err()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:88:9
|
||||
|
|
||||
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| --------- because of this check
|
||||
...
|
||||
88 | y.unwrap_err(); // will panic
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:89:9
|
||||
|
|
||||
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| ---------- because of this check
|
||||
...
|
||||
89 | z.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:90:9
|
||||
|
|
||||
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
||||
| ---------- the check is happening here
|
||||
...
|
||||
90 | z.unwrap_err(); // unnecessary
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
||||
--> $DIR/checked_unwrap.rs:98:13
|
||||
|
|
||||
97 | if x.is_some() {
|
||||
| ----------- the check is happening here
|
||||
96 | x.unwrap(); // unnecessary
|
||||
98 | x.unwrap(); // unnecessary
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: This call to `unwrap()` will always panic.
|
||||
--> $DIR/checked_unwrap.rs:98:13
|
||||
|
|
||||
95 | if x.is_some() {
|
||||
| ----------- because of this check
|
||||
--> $DIR/checked_unwrap.rs:100:13
|
||||
|
|
||||
97 | if x.is_some() {
|
||||
| ----------- because of this check
|
||||
...
|
||||
98 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
100 | x.unwrap(); // will panic
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: aborting due to 34 previous errors
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
|
|||
8 | x == std::f32::NAN;
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D cmp-nan` implied by `-D warnings`
|
||||
= note: `-D clippy::cmp-nan` implied by `-D warnings`
|
||||
|
||||
error: doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead
|
||||
--> $DIR/cmp_nan.rs:9:5
|
||||
|
|
|
@ -4,7 +4,7 @@ error: Comparing with null is better expressed by the .is_null() method
|
|||
11 | if p == ptr::null() {
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D cmp-null` implied by `-D warnings`
|
||||
= note: `-D clippy::cmp-null` implied by `-D warnings`
|
||||
|
||||
error: Comparing with null is better expressed by the .is_null() method
|
||||
--> $DIR/cmp_null.rs:16:8
|
||||
|
|
|
@ -4,7 +4,7 @@ error: this creates an owned instance just for comparison
|
|||
8 | x != "foo".to_string();
|
||||
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
||||
|
|
||||
= note: `-D cmp-owned` implied by `-D warnings`
|
||||
= note: `-D clippy::cmp-owned` implied by `-D warnings`
|
||||
|
||||
error: this creates an owned instance just for comparison
|
||||
--> $DIR/cmp_owned.rs:10:9
|
||||
|
|
|
@ -8,7 +8,7 @@ error: this if statement can be collapsed
|
|||
12 | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: `-D collapsible-if` implied by `-D warnings`
|
||||
= note: `-D clippy::collapsible-if` implied by `-D warnings`
|
||||
help: try
|
||||
|
|
||||
8 | if x == "hello" && y == "world" {
|
||||
|
|
|
@ -4,7 +4,7 @@ error: very complex type used. Consider factoring parts into `type` definitions
|
|||
9 | const CST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D type-complexity` implied by `-D warnings`
|
||||
= note: `-D clippy::type-complexity` implied by `-D warnings`
|
||||
|
||||
error: very complex type used. Consider factoring parts into `type` definitions
|
||||
--> $DIR/complex_types.rs:10:12
|
||||
|
|
|
@ -4,7 +4,7 @@ error: Constants have by default a `'static` lifetime
|
|||
4 | const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static.
|
||||
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
||||
|
|
||||
= note: `-D const-static-lifetime` implied by `-D warnings`
|
||||
= note: `-D clippy::const-static-lifetime` implied by `-D warnings`
|
||||
|
||||
error: Constants have by default a `'static` lifetime
|
||||
--> $DIR/const_static_lifetime.rs:8:21
|
||||
|
|
|
@ -1,384 +1,384 @@
|
|||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:29:10
|
||||
--> $DIR/copies.rs:31:10
|
||||
|
|
||||
29 | else { //~ ERROR same body as `if` block
|
||||
31 | else { //~ ERROR same body as `if` block
|
||||
| __________^
|
||||
30 | | Foo { bar: 42 };
|
||||
31 | | 0..10;
|
||||
32 | | ..;
|
||||
32 | | Foo { bar: 42 };
|
||||
33 | | 0..10;
|
||||
34 | | ..;
|
||||
... |
|
||||
36 | | foo();
|
||||
37 | | }
|
||||
38 | | foo();
|
||||
39 | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: `-D if-same-then-else` implied by `-D warnings`
|
||||
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:20:13
|
||||
--> $DIR/copies.rs:22:13
|
||||
|
|
||||
20 | if true {
|
||||
22 | if true {
|
||||
| _____________^
|
||||
21 | | Foo { bar: 42 };
|
||||
22 | | 0..10;
|
||||
23 | | ..;
|
||||
23 | | Foo { bar: 42 };
|
||||
24 | | 0..10;
|
||||
25 | | ..;
|
||||
... |
|
||||
27 | | foo();
|
||||
28 | | }
|
||||
29 | | foo();
|
||||
30 | | }
|
||||
| |_____^
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
--> $DIR/copies.rs:78:14
|
||||
--> $DIR/copies.rs:80:14
|
||||
|
|
||||
78 | _ => { //~ ERROR match arms have same body
|
||||
80 | _ => { //~ ERROR match arms have same body
|
||||
| ______________^
|
||||
79 | | foo();
|
||||
80 | | let mut a = 42 + [23].len() as i32;
|
||||
81 | | if true {
|
||||
81 | | foo();
|
||||
82 | | let mut a = 42 + [23].len() as i32;
|
||||
83 | | if true {
|
||||
... |
|
||||
85 | | a
|
||||
86 | | }
|
||||
87 | | a
|
||||
88 | | }
|
||||
| |_________^
|
||||
|
|
||||
= note: `-D match-same-arms` implied by `-D warnings`
|
||||
= note: `-D clippy::match-same-arms` implied by `-D warnings`
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:69:15
|
||||
--> $DIR/copies.rs:71:15
|
||||
|
|
||||
69 | 42 => {
|
||||
71 | 42 => {
|
||||
| _______________^
|
||||
70 | | foo();
|
||||
71 | | let mut a = 42 + [23].len() as i32;
|
||||
72 | | if true {
|
||||
72 | | foo();
|
||||
73 | | let mut a = 42 + [23].len() as i32;
|
||||
74 | | if true {
|
||||
... |
|
||||
76 | | a
|
||||
77 | | }
|
||||
78 | | a
|
||||
79 | | }
|
||||
| |_________^
|
||||
note: `42` has the same arm body as the `_` wildcard, consider removing it`
|
||||
--> $DIR/copies.rs:69:15
|
||||
--> $DIR/copies.rs:71:15
|
||||
|
|
||||
69 | 42 => {
|
||||
71 | 42 => {
|
||||
| _______________^
|
||||
70 | | foo();
|
||||
71 | | let mut a = 42 + [23].len() as i32;
|
||||
72 | | if true {
|
||||
72 | | foo();
|
||||
73 | | let mut a = 42 + [23].len() as i32;
|
||||
74 | | if true {
|
||||
... |
|
||||
76 | | a
|
||||
77 | | }
|
||||
78 | | a
|
||||
79 | | }
|
||||
| |_________^
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
--> $DIR/copies.rs:92:14
|
||||
--> $DIR/copies.rs:94:14
|
||||
|
|
||||
92 | _ => 0, //~ ERROR match arms have same body
|
||||
94 | _ => 0, //~ ERROR match arms have same body
|
||||
| ^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:90:19
|
||||
--> $DIR/copies.rs:92:19
|
||||
|
|
||||
90 | Abc::A => 0,
|
||||
92 | Abc::A => 0,
|
||||
| ^
|
||||
note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
|
||||
--> $DIR/copies.rs:90:19
|
||||
--> $DIR/copies.rs:92:19
|
||||
|
|
||||
90 | Abc::A => 0,
|
||||
92 | Abc::A => 0,
|
||||
| ^
|
||||
|
||||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:102:10
|
||||
--> $DIR/copies.rs:104:10
|
||||
|
|
||||
102 | else { //~ ERROR same body as `if` block
|
||||
104 | else { //~ ERROR same body as `if` block
|
||||
| __________^
|
||||
103 | | 42
|
||||
104 | | };
|
||||
105 | | 42
|
||||
106 | | };
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:99:21
|
||||
--> $DIR/copies.rs:101:21
|
||||
|
|
||||
99 | let _ = if true {
|
||||
101 | let _ = if true {
|
||||
| _____________________^
|
||||
100 | | 42
|
||||
101 | | }
|
||||
102 | | 42
|
||||
103 | | }
|
||||
| |_____^
|
||||
|
||||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:116:10
|
||||
--> $DIR/copies.rs:118:10
|
||||
|
|
||||
116 | else { //~ ERROR same body as `if` block
|
||||
118 | else { //~ ERROR same body as `if` block
|
||||
| __________^
|
||||
117 | | for _ in &[42] {
|
||||
118 | | let foo: &Option<_> = &Some::<u8>(42);
|
||||
119 | | if true {
|
||||
119 | | for _ in &[42] {
|
||||
120 | | let foo: &Option<_> = &Some::<u8>(42);
|
||||
121 | | if true {
|
||||
... |
|
||||
124 | | }
|
||||
125 | | }
|
||||
126 | | }
|
||||
127 | | }
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:106:13
|
||||
--> $DIR/copies.rs:108:13
|
||||
|
|
||||
106 | if true {
|
||||
108 | if true {
|
||||
| _____________^
|
||||
107 | | for _ in &[42] {
|
||||
108 | | let foo: &Option<_> = &Some::<u8>(42);
|
||||
109 | | if true {
|
||||
109 | | for _ in &[42] {
|
||||
110 | | let foo: &Option<_> = &Some::<u8>(42);
|
||||
111 | | if true {
|
||||
... |
|
||||
114 | | }
|
||||
115 | | }
|
||||
116 | | }
|
||||
117 | | }
|
||||
| |_____^
|
||||
|
||||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:138:10
|
||||
--> $DIR/copies.rs:140:10
|
||||
|
|
||||
138 | else { //~ ERROR same body as `if` block
|
||||
140 | else { //~ ERROR same body as `if` block
|
||||
| __________^
|
||||
139 | | let bar = if true {
|
||||
140 | | 42
|
||||
141 | | }
|
||||
141 | | let bar = if true {
|
||||
142 | | 42
|
||||
143 | | }
|
||||
... |
|
||||
147 | | bar + 1;
|
||||
148 | | }
|
||||
149 | | bar + 1;
|
||||
150 | | }
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:127:13
|
||||
--> $DIR/copies.rs:129:13
|
||||
|
|
||||
127 | if true {
|
||||
129 | if true {
|
||||
| _____________^
|
||||
128 | | let bar = if true {
|
||||
129 | | 42
|
||||
130 | | }
|
||||
130 | | let bar = if true {
|
||||
131 | | 42
|
||||
132 | | }
|
||||
... |
|
||||
136 | | bar + 1;
|
||||
137 | | }
|
||||
138 | | bar + 1;
|
||||
139 | | }
|
||||
| |_____^
|
||||
|
||||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:173:10
|
||||
--> $DIR/copies.rs:175:10
|
||||
|
|
||||
173 | else { //~ ERROR same body as `if` block
|
||||
175 | else { //~ ERROR same body as `if` block
|
||||
| __________^
|
||||
174 | | if let Some(a) = Some(42) {}
|
||||
175 | | }
|
||||
176 | | if let Some(a) = Some(42) {}
|
||||
177 | | }
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:170:13
|
||||
--> $DIR/copies.rs:172:13
|
||||
|
|
||||
170 | if true {
|
||||
172 | if true {
|
||||
| _____________^
|
||||
171 | | if let Some(a) = Some(42) {}
|
||||
172 | | }
|
||||
173 | | if let Some(a) = Some(42) {}
|
||||
174 | | }
|
||||
| |_____^
|
||||
|
||||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:180:10
|
||||
--> $DIR/copies.rs:182:10
|
||||
|
|
||||
180 | else { //~ ERROR same body as `if` block
|
||||
182 | else { //~ ERROR same body as `if` block
|
||||
| __________^
|
||||
181 | | if let (1, .., 3) = (1, 2, 3) {}
|
||||
182 | | }
|
||||
183 | | if let (1, .., 3) = (1, 2, 3) {}
|
||||
184 | | }
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:177:13
|
||||
--> $DIR/copies.rs:179:13
|
||||
|
|
||||
177 | if true {
|
||||
179 | if true {
|
||||
| _____________^
|
||||
178 | | if let (1, .., 3) = (1, 2, 3) {}
|
||||
179 | | }
|
||||
180 | | if let (1, .., 3) = (1, 2, 3) {}
|
||||
181 | | }
|
||||
| |_____^
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
--> $DIR/copies.rs:235:15
|
||||
--> $DIR/copies.rs:237:15
|
||||
|
|
||||
235 | 51 => foo(), //~ ERROR match arms have same body
|
||||
237 | 51 => foo(), //~ ERROR match arms have same body
|
||||
| ^^^^^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:234:15
|
||||
--> $DIR/copies.rs:236:15
|
||||
|
|
||||
234 | 42 => foo(),
|
||||
236 | 42 => foo(),
|
||||
| ^^^^^
|
||||
note: consider refactoring into `42 | 51`
|
||||
--> $DIR/copies.rs:234:15
|
||||
--> $DIR/copies.rs:236:15
|
||||
|
|
||||
234 | 42 => foo(),
|
||||
236 | 42 => foo(),
|
||||
| ^^^^^
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
--> $DIR/copies.rs:241:17
|
||||
--> $DIR/copies.rs:243:17
|
||||
|
|
||||
241 | None => 24, //~ ERROR match arms have same body
|
||||
243 | None => 24, //~ ERROR match arms have same body
|
||||
| ^^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:240:20
|
||||
--> $DIR/copies.rs:242:20
|
||||
|
|
||||
240 | Some(_) => 24,
|
||||
242 | Some(_) => 24,
|
||||
| ^^
|
||||
note: consider refactoring into `Some(_) | None`
|
||||
--> $DIR/copies.rs:240:20
|
||||
--> $DIR/copies.rs:242:20
|
||||
|
|
||||
240 | Some(_) => 24,
|
||||
242 | Some(_) => 24,
|
||||
| ^^
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
--> $DIR/copies.rs:263:28
|
||||
--> $DIR/copies.rs:265:28
|
||||
|
|
||||
263 | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
|
||||
265 | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
|
||||
| ^^^^^^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:262:28
|
||||
--> $DIR/copies.rs:264:28
|
||||
|
|
||||
262 | (Some(a), None) => bar(a),
|
||||
264 | (Some(a), None) => bar(a),
|
||||
| ^^^^^^
|
||||
note: consider refactoring into `(Some(a), None) | (None, Some(a))`
|
||||
--> $DIR/copies.rs:262:28
|
||||
--> $DIR/copies.rs:264:28
|
||||
|
|
||||
262 | (Some(a), None) => bar(a),
|
||||
264 | (Some(a), None) => bar(a),
|
||||
| ^^^^^^
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
--> $DIR/copies.rs:269:26
|
||||
--> $DIR/copies.rs:271:26
|
||||
|
|
||||
269 | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
|
||||
271 | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
|
||||
| ^^^^^^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:268:26
|
||||
--> $DIR/copies.rs:270:26
|
||||
|
|
||||
268 | (Some(a), ..) => bar(a),
|
||||
270 | (Some(a), ..) => bar(a),
|
||||
| ^^^^^^
|
||||
note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
|
||||
--> $DIR/copies.rs:268:26
|
||||
--> $DIR/copies.rs:270:26
|
||||
|
|
||||
268 | (Some(a), ..) => bar(a),
|
||||
270 | (Some(a), ..) => bar(a),
|
||||
| ^^^^^^
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
--> $DIR/copies.rs:275:20
|
||||
--> $DIR/copies.rs:277:20
|
||||
|
|
||||
275 | (.., 3) => 42, //~ ERROR match arms have same body
|
||||
277 | (.., 3) => 42, //~ ERROR match arms have same body
|
||||
| ^^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:274:23
|
||||
--> $DIR/copies.rs:276:23
|
||||
|
|
||||
274 | (1, .., 3) => 42,
|
||||
276 | (1, .., 3) => 42,
|
||||
| ^^
|
||||
note: consider refactoring into `(1, .., 3) | (.., 3)`
|
||||
--> $DIR/copies.rs:274:23
|
||||
--> $DIR/copies.rs:276:23
|
||||
|
|
||||
274 | (1, .., 3) => 42,
|
||||
276 | (1, .., 3) => 42,
|
||||
| ^^
|
||||
|
||||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:281:12
|
||||
--> $DIR/copies.rs:283:12
|
||||
|
|
||||
281 | } else { //~ ERROR same body as `if` block
|
||||
283 | } else { //~ ERROR same body as `if` block
|
||||
| ____________^
|
||||
284 | | 0.0
|
||||
285 | | };
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:281:21
|
||||
|
|
||||
281 | let _ = if true {
|
||||
| _____________________^
|
||||
282 | | 0.0
|
||||
283 | | };
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:279:21
|
||||
|
|
||||
279 | let _ = if true {
|
||||
| _____________________^
|
||||
280 | | 0.0
|
||||
281 | | } else { //~ ERROR same body as `if` block
|
||||
283 | | } else { //~ ERROR same body as `if` block
|
||||
| |_____^
|
||||
|
||||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:287:12
|
||||
--> $DIR/copies.rs:289:12
|
||||
|
|
||||
287 | } else { //~ ERROR same body as `if` block
|
||||
289 | } else { //~ ERROR same body as `if` block
|
||||
| ____________^
|
||||
290 | | -0.0
|
||||
291 | | };
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:287:21
|
||||
|
|
||||
287 | let _ = if true {
|
||||
| _____________________^
|
||||
288 | | -0.0
|
||||
289 | | };
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:285:21
|
||||
|
|
||||
285 | let _ = if true {
|
||||
| _____________________^
|
||||
286 | | -0.0
|
||||
287 | | } else { //~ ERROR same body as `if` block
|
||||
289 | | } else { //~ ERROR same body as `if` block
|
||||
| |_____^
|
||||
|
||||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:307:12
|
||||
--> $DIR/copies.rs:309:12
|
||||
|
|
||||
307 | } else { //~ ERROR same body as `if` block
|
||||
309 | } else { //~ ERROR same body as `if` block
|
||||
| ____________^
|
||||
308 | | std::f32::NAN
|
||||
309 | | };
|
||||
310 | | std::f32::NAN
|
||||
311 | | };
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:305:21
|
||||
--> $DIR/copies.rs:307:21
|
||||
|
|
||||
305 | let _ = if true {
|
||||
307 | let _ = if true {
|
||||
| _____________________^
|
||||
306 | | std::f32::NAN
|
||||
307 | | } else { //~ ERROR same body as `if` block
|
||||
308 | | std::f32::NAN
|
||||
309 | | } else { //~ ERROR same body as `if` block
|
||||
| |_____^
|
||||
|
||||
error: this `if` has identical blocks
|
||||
--> $DIR/copies.rs:325:10
|
||||
--> $DIR/copies.rs:327:10
|
||||
|
|
||||
325 | else { //~ ERROR same body as `if` block
|
||||
327 | else { //~ ERROR same body as `if` block
|
||||
| __________^
|
||||
326 | | try!(Ok("foo"));
|
||||
327 | | }
|
||||
328 | | try!(Ok("foo"));
|
||||
329 | | }
|
||||
| |_____^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:322:13
|
||||
--> $DIR/copies.rs:324:13
|
||||
|
|
||||
322 | if true {
|
||||
324 | if true {
|
||||
| _____________^
|
||||
323 | | try!(Ok("foo"));
|
||||
324 | | }
|
||||
325 | | try!(Ok("foo"));
|
||||
326 | | }
|
||||
| |_____^
|
||||
|
||||
error: this `if` has the same condition as a previous if
|
||||
--> $DIR/copies.rs:351:13
|
||||
--> $DIR/copies.rs:353:13
|
||||
|
|
||||
351 | else if b { //~ ERROR ifs same condition
|
||||
353 | else if b { //~ ERROR ifs same condition
|
||||
| ^
|
||||
|
|
||||
= note: `-D ifs-same-cond` implied by `-D warnings`
|
||||
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:349:8
|
||||
--> $DIR/copies.rs:351:8
|
||||
|
|
||||
349 | if b {
|
||||
351 | if b {
|
||||
| ^
|
||||
|
||||
error: this `if` has the same condition as a previous if
|
||||
--> $DIR/copies.rs:356:13
|
||||
--> $DIR/copies.rs:358:13
|
||||
|
|
||||
356 | else if a == 1 { //~ ERROR ifs same condition
|
||||
358 | else if a == 1 { //~ ERROR ifs same condition
|
||||
| ^^^^^^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:354:8
|
||||
--> $DIR/copies.rs:356:8
|
||||
|
|
||||
354 | if a == 1 {
|
||||
356 | if a == 1 {
|
||||
| ^^^^^^
|
||||
|
||||
error: this `if` has the same condition as a previous if
|
||||
--> $DIR/copies.rs:363:13
|
||||
--> $DIR/copies.rs:365:13
|
||||
|
|
||||
363 | else if 2*a == 1 { //~ ERROR ifs same condition
|
||||
365 | else if 2*a == 1 { //~ ERROR ifs same condition
|
||||
| ^^^^^^^^
|
||||
|
|
||||
note: same as this
|
||||
--> $DIR/copies.rs:359:8
|
||||
--> $DIR/copies.rs:361:8
|
||||
|
|
||||
359 | if 2*a == 1 {
|
||||
361 | if 2*a == 1 {
|
||||
| ^^^^^^^^
|
||||
|
||||
error: aborting due to 20 previous errors
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
error: you are implementing `Iterator` on a `Copy` type
|
||||
--> $DIR/copy_iterator.rs:6:1
|
||||
--> $DIR/copy_iterator.rs:8:1
|
||||
|
|
||||
6 | / impl Iterator for Countdown {
|
||||
7 | | type Item = u8;
|
||||
8 | |
|
||||
9 | | fn next(&mut self) -> Option<u8> {
|
||||
8 | / impl Iterator for Countdown {
|
||||
9 | | type Item = u8;
|
||||
10 | |
|
||||
11 | | fn next(&mut self) -> Option<u8> {
|
||||
... |
|
||||
14 | | }
|
||||
15 | | }
|
||||
16 | | }
|
||||
17 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D copy-iterator` implied by `-D warnings`
|
||||
= note: `-D clippy::copy-iterator` implied by `-D warnings`
|
||||
= note: consider implementing `IntoIterator` instead
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
error: you are getting the inner pointer of a temporary `CString`
|
||||
--> $DIR/cstring.rs:7:5
|
||||
--> $DIR/cstring.rs:9:5
|
||||
|
|
||||
7 | CString::new("foo").unwrap().as_ptr();
|
||||
9 | CString::new("foo").unwrap().as_ptr();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: #[deny(temporary_cstring_as_ptr)] on by default
|
||||
= note: #[deny(clippy::temporary_cstring_as_ptr)] on by default
|
||||
= note: that pointer will be invalid outside this expression
|
||||
help: assign the `CString` to a variable to extend its lifetime
|
||||
--> $DIR/cstring.rs:7:5
|
||||
--> $DIR/cstring.rs:9:5
|
||||
|
|
||||
7 | CString::new("foo").unwrap().as_ptr();
|
||||
9 | CString::new("foo").unwrap().as_ptr();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
@ -10,7 +10,7 @@ error: the function has a cyclomatic complexity of 28
|
|||
89 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D cyclomatic-complexity` implied by `-D warnings`
|
||||
= note: `-D clippy::cyclomatic-complexity` implied by `-D warnings`
|
||||
= help: you could split it up into multiple smaller functions
|
||||
|
||||
error: the function has a cyclomatic complexity of 7
|
||||
|
|
|
@ -10,7 +10,7 @@ error: the function has a cyclomatic complexity of 3
|
|||
17 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D cyclomatic-complexity` implied by `-D warnings`
|
||||
= note: `-D clippy::cyclomatic-complexity` implied by `-D warnings`
|
||||
= help: you could split it up into multiple smaller functions
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
@ -4,7 +4,7 @@ error: integer literal has a better hexadecimal representation
|
|||
18 | 32_773, // 0x8005
|
||||
| ^^^^^^ help: consider: `0x8005`
|
||||
|
|
||||
= note: `-D decimal-literal-representation` implied by `-D warnings`
|
||||
= note: `-D clippy::decimal-literal-representation` implied by `-D warnings`
|
||||
|
||||
error: integer literal has a better hexadecimal representation
|
||||
--> $DIR/decimal_literal_representation.rs:19:9
|
||||
|
|
|
@ -1,51 +1,51 @@
|
|||
error: Calling std::string::String::default() is more clear than this expression
|
||||
--> $DIR/default_trait_access.rs:8:22
|
||||
|
|
||||
8 | let s1: String = Default::default();
|
||||
| ^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
|
||||
|
|
||||
= note: `-D default-trait-access` implied by `-D warnings`
|
||||
|
||||
error: Calling std::string::String::default() is more clear than this expression
|
||||
--> $DIR/default_trait_access.rs:12:22
|
||||
--> $DIR/default_trait_access.rs:10:22
|
||||
|
|
||||
12 | let s3: String = D2::default();
|
||||
| ^^^^^^^^^^^^^ help: try: `std::string::String::default()`
|
||||
10 | let s1: String = Default::default();
|
||||
| ^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
|
||||
|
|
||||
= note: `-D clippy::default-trait-access` implied by `-D warnings`
|
||||
|
||||
error: Calling std::string::String::default() is more clear than this expression
|
||||
--> $DIR/default_trait_access.rs:14:22
|
||||
|
|
||||
14 | let s4: String = std::default::Default::default();
|
||||
14 | let s3: String = D2::default();
|
||||
| ^^^^^^^^^^^^^ help: try: `std::string::String::default()`
|
||||
|
||||
error: Calling std::string::String::default() is more clear than this expression
|
||||
--> $DIR/default_trait_access.rs:16:22
|
||||
|
|
||||
16 | let s4: String = std::default::Default::default();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
|
||||
|
||||
error: Calling std::string::String::default() is more clear than this expression
|
||||
--> $DIR/default_trait_access.rs:18:22
|
||||
--> $DIR/default_trait_access.rs:20:22
|
||||
|
|
||||
18 | let s6: String = default::Default::default();
|
||||
20 | let s6: String = default::Default::default();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
|
||||
|
||||
error: Calling GenericDerivedDefault<std::string::String>::default() is more clear than this expression
|
||||
--> $DIR/default_trait_access.rs:28:46
|
||||
--> $DIR/default_trait_access.rs:30:46
|
||||
|
|
||||
28 | let s11: GenericDerivedDefault<String> = Default::default();
|
||||
30 | let s11: GenericDerivedDefault<String> = Default::default();
|
||||
| ^^^^^^^^^^^^^^^^^^ help: try: `GenericDerivedDefault<std::string::String>::default()`
|
||||
|
||||
error: Calling TupleDerivedDefault::default() is more clear than this expression
|
||||
--> $DIR/default_trait_access.rs:34:36
|
||||
--> $DIR/default_trait_access.rs:36:36
|
||||
|
|
||||
34 | let s14: TupleDerivedDefault = Default::default();
|
||||
36 | let s14: TupleDerivedDefault = Default::default();
|
||||
| ^^^^^^^^^^^^^^^^^^ help: try: `TupleDerivedDefault::default()`
|
||||
|
||||
error: Calling ArrayDerivedDefault::default() is more clear than this expression
|
||||
--> $DIR/default_trait_access.rs:36:36
|
||||
--> $DIR/default_trait_access.rs:38:36
|
||||
|
|
||||
36 | let s15: ArrayDerivedDefault = Default::default();
|
||||
38 | let s15: ArrayDerivedDefault = Default::default();
|
||||
| ^^^^^^^^^^^^^^^^^^ help: try: `ArrayDerivedDefault::default()`
|
||||
|
||||
error: Calling TupleStructDerivedDefault::default() is more clear than this expression
|
||||
--> $DIR/default_trait_access.rs:40:42
|
||||
--> $DIR/default_trait_access.rs:42:42
|
||||
|
|
||||
40 | let s17: TupleStructDerivedDefault = Default::default();
|
||||
42 | let s17: TupleStructDerivedDefault = Default::default();
|
||||
| ^^^^^^^^^^^^^^^^^^ help: try: `TupleStructDerivedDefault::default()`
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: you are deriving `Hash` but have implemented `PartialEq` explicitly
|
|||
17 | #[derive(Hash)]
|
||||
| ^^^^
|
||||
|
|
||||
= note: #[deny(derive_hash_xor_eq)] on by default
|
||||
= note: #[deny(clippy::derive_hash_xor_eq)] on by default
|
||||
note: `PartialEq` implemented here
|
||||
--> $DIR/derive.rs:20:1
|
||||
|
|
||||
|
@ -49,7 +49,7 @@ error: you are implementing `Clone` explicitly on a `Copy` type
|
|||
43 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D expl-impl-clone-on-copy` implied by `-D warnings`
|
||||
= note: `-D clippy::expl-impl-clone-on-copy` implied by `-D warnings`
|
||||
note: consider deriving `Clone` or removing `Copy`
|
||||
--> $DIR/derive.rs:41:1
|
||||
|
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:18:10
|
||||
--> $DIR/diverging_sub_expression.rs:20:10
|
||||
|
|
||||
18 | b || diverge();
|
||||
20 | b || diverge();
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: `-D diverging-sub-expression` implied by `-D warnings`
|
||||
= note: `-D clippy::diverging-sub-expression` implied by `-D warnings`
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:19:10
|
||||
--> $DIR/diverging_sub_expression.rs:21:10
|
||||
|
|
||||
19 | b || A.foo();
|
||||
21 | b || A.foo();
|
||||
| ^^^^^^^
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:28:26
|
||||
--> $DIR/diverging_sub_expression.rs:30:26
|
||||
|
|
||||
28 | 6 => true || return,
|
||||
30 | 6 => true || return,
|
||||
| ^^^^^^
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:29:26
|
||||
--> $DIR/diverging_sub_expression.rs:31:26
|
||||
|
|
||||
29 | 7 => true || continue,
|
||||
31 | 7 => true || continue,
|
||||
| ^^^^^^^^
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:32:26
|
||||
--> $DIR/diverging_sub_expression.rs:34:26
|
||||
|
|
||||
32 | 3 => true || diverge(),
|
||||
34 | 3 => true || diverge(),
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:37:26
|
||||
--> $DIR/diverging_sub_expression.rs:39:26
|
||||
|
|
||||
37 | _ => true || break,
|
||||
39 | _ => true || break,
|
||||
| ^^^^^
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
|
|
@ -1,48 +1,48 @@
|
|||
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
|
||||
--> $DIR/dlist.rs:12:16
|
||||
--> $DIR/dlist.rs:14:16
|
||||
|
|
||||
12 | type Baz = LinkedList<u8>;
|
||||
14 | type Baz = LinkedList<u8>;
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D linkedlist` implied by `-D warnings`
|
||||
= note: `-D clippy::linkedlist` implied by `-D warnings`
|
||||
= help: a VecDeque might work
|
||||
|
||||
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
|
||||
--> $DIR/dlist.rs:13:12
|
||||
--> $DIR/dlist.rs:15:12
|
||||
|
|
||||
13 | fn foo(LinkedList<u8>);
|
||||
15 | fn foo(LinkedList<u8>);
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: a VecDeque might work
|
||||
|
||||
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
|
||||
--> $DIR/dlist.rs:14:24
|
||||
--> $DIR/dlist.rs:16:24
|
||||
|
|
||||
14 | const BAR : Option<LinkedList<u8>>;
|
||||
16 | 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?
|
||||
--> $DIR/dlist.rs:25:15
|
||||
--> $DIR/dlist.rs:27:15
|
||||
|
|
||||
25 | fn foo(_: LinkedList<u8>) {}
|
||||
27 | fn foo(_: LinkedList<u8>) {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: a VecDeque might work
|
||||
|
||||
error: I see you're using a LinkedList! Perhaps you meant some other data structure?
|
||||
--> $DIR/dlist.rs:28:39
|
||||
--> $DIR/dlist.rs:30:39
|
||||
|
|
||||
28 | pub fn test(my_favourite_linked_list: LinkedList<u8>) {
|
||||
30 | 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?
|
||||
--> $DIR/dlist.rs:32:29
|
||||
--> $DIR/dlist.rs:34:29
|
||||
|
|
||||
32 | pub fn test_ret() -> Option<LinkedList<u8>> {
|
||||
34 | pub fn test_ret() -> Option<LinkedList<u8>> {
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: a VecDeque might work
|
||||
|
|
|
@ -1,183 +1,183 @@
|
|||
error: you should put `DOC_MARKDOWN` between ticks in the documentation
|
||||
--> $DIR/doc.rs:1:29
|
||||
--> $DIR/doc.rs:3:29
|
||||
|
|
||||
1 | //! This file tests for the DOC_MARKDOWN lint
|
||||
3 | //! This file tests for the DOC_MARKDOWN lint
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D doc-markdown` implied by `-D warnings`
|
||||
= note: `-D clippy::doc-markdown` implied by `-D warnings`
|
||||
|
||||
error: you should put `foo_bar` between ticks in the documentation
|
||||
--> $DIR/doc.rs:8:9
|
||||
|
|
||||
8 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
|
||||
| ^^^^^^^
|
||||
--> $DIR/doc.rs:10:9
|
||||
|
|
||||
10 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
|
||||
| ^^^^^^^
|
||||
|
||||
error: you should put `foo::bar` between ticks in the documentation
|
||||
--> $DIR/doc.rs:8:51
|
||||
|
|
||||
8 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
|
||||
| ^^^^^^^^
|
||||
--> $DIR/doc.rs:10:51
|
||||
|
|
||||
10 | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
|
||||
| ^^^^^^^^
|
||||
|
||||
error: you should put `Foo::some_fun` between ticks in the documentation
|
||||
--> $DIR/doc.rs:9:84
|
||||
|
|
||||
9 | /// Markdown is _weird_. I mean _really weird_. This /_ is ok. So is `_`. But not Foo::some_fun
|
||||
| ^^^^^^^^^^^^^
|
||||
--> $DIR/doc.rs:11:84
|
||||
|
|
||||
11 | /// Markdown is _weird_. I mean _really weird_. This /_ is ok. So is `_`. But not Foo::some_fun
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `a::global:path` between ticks in the documentation
|
||||
--> $DIR/doc.rs:11:15
|
||||
--> $DIR/doc.rs:13:15
|
||||
|
|
||||
11 | /// Here be ::a::global:path.
|
||||
13 | /// Here be ::a::global:path.
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `NotInCodeBlock` between ticks in the documentation
|
||||
--> $DIR/doc.rs:12:22
|
||||
--> $DIR/doc.rs:14:22
|
||||
|
|
||||
12 | /// That's not code ~NotInCodeBlock~.
|
||||
14 | /// That's not code ~NotInCodeBlock~.
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:13:5
|
||||
--> $DIR/doc.rs:15:5
|
||||
|
|
||||
13 | /// be_sure_we_got_to_the_end_of_it
|
||||
15 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:27:5
|
||||
--> $DIR/doc.rs:29:5
|
||||
|
|
||||
27 | /// be_sure_we_got_to_the_end_of_it
|
||||
29 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:34:5
|
||||
--> $DIR/doc.rs:36:5
|
||||
|
|
||||
34 | /// be_sure_we_got_to_the_end_of_it
|
||||
36 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:48:5
|
||||
--> $DIR/doc.rs:50:5
|
||||
|
|
||||
48 | /// be_sure_we_got_to_the_end_of_it
|
||||
50 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `link_with_underscores` between ticks in the documentation
|
||||
--> $DIR/doc.rs:52:22
|
||||
--> $DIR/doc.rs:54:22
|
||||
|
|
||||
52 | /// This test has [a link_with_underscores][chunked-example] inside it. See #823.
|
||||
54 | /// This test has [a link_with_underscores][chunked-example] inside it. See #823.
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `inline_link2` between ticks in the documentation
|
||||
--> $DIR/doc.rs:55:21
|
||||
--> $DIR/doc.rs:57:21
|
||||
|
|
||||
55 | /// It can also be [inline_link2].
|
||||
57 | /// It can also be [inline_link2].
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:65:5
|
||||
--> $DIR/doc.rs:67:5
|
||||
|
|
||||
65 | /// be_sure_we_got_to_the_end_of_it
|
||||
67 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `CamelCaseThing` between ticks in the documentation
|
||||
--> $DIR/doc.rs:73:8
|
||||
--> $DIR/doc.rs:75:8
|
||||
|
|
||||
73 | /// ## CamelCaseThing
|
||||
75 | /// ## CamelCaseThing
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `CamelCaseThing` between ticks in the documentation
|
||||
--> $DIR/doc.rs:76:7
|
||||
--> $DIR/doc.rs:78:7
|
||||
|
|
||||
76 | /// # CamelCaseThing
|
||||
78 | /// # CamelCaseThing
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `CamelCaseThing` between ticks in the documentation
|
||||
--> $DIR/doc.rs:78:22
|
||||
--> $DIR/doc.rs:80:22
|
||||
|
|
||||
78 | /// Not a title #897 CamelCaseThing
|
||||
80 | /// Not a title #897 CamelCaseThing
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:79:5
|
||||
--> $DIR/doc.rs:81:5
|
||||
|
|
||||
79 | /// be_sure_we_got_to_the_end_of_it
|
||||
81 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:86:5
|
||||
--> $DIR/doc.rs:88:5
|
||||
|
|
||||
86 | /// be_sure_we_got_to_the_end_of_it
|
||||
88 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:99:5
|
||||
|
|
||||
99 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `FooBar` between ticks in the documentation
|
||||
--> $DIR/doc.rs:110:42
|
||||
--> $DIR/doc.rs:101:5
|
||||
|
|
||||
110 | /** E.g. serialization of an empty list: FooBar
|
||||
| ^^^^^^
|
||||
|
||||
error: you should put `BarQuz` between ticks in the documentation
|
||||
--> $DIR/doc.rs:115:5
|
||||
|
|
||||
115 | And BarQuz too.
|
||||
| ^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:116:1
|
||||
|
|
||||
116 | be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `FooBar` between ticks in the documentation
|
||||
--> $DIR/doc.rs:121:42
|
||||
|
|
||||
121 | /** E.g. serialization of an empty list: FooBar
|
||||
| ^^^^^^
|
||||
|
||||
error: you should put `BarQuz` between ticks in the documentation
|
||||
--> $DIR/doc.rs:126:5
|
||||
|
|
||||
126 | And BarQuz too.
|
||||
| ^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:127:1
|
||||
|
|
||||
127 | be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:138:5
|
||||
|
|
||||
138 | /// be_sure_we_got_to_the_end_of_it
|
||||
101 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
|
||||
--> $DIR/doc.rs:165:13
|
||||
error: you should put `FooBar` between ticks in the documentation
|
||||
--> $DIR/doc.rs:112:42
|
||||
|
|
||||
165 | /// Not ok: http://www.unicode.org
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
112 | /** E.g. serialization of an empty list: FooBar
|
||||
| ^^^^^^
|
||||
|
||||
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
|
||||
--> $DIR/doc.rs:166:13
|
||||
error: you should put `BarQuz` between ticks in the documentation
|
||||
--> $DIR/doc.rs:117:5
|
||||
|
|
||||
166 | /// Not ok: https://www.unicode.org
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
117 | And BarQuz too.
|
||||
| ^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:118:1
|
||||
|
|
||||
118 | be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `FooBar` between ticks in the documentation
|
||||
--> $DIR/doc.rs:123:42
|
||||
|
|
||||
123 | /** E.g. serialization of an empty list: FooBar
|
||||
| ^^^^^^
|
||||
|
||||
error: you should put `BarQuz` between ticks in the documentation
|
||||
--> $DIR/doc.rs:128:5
|
||||
|
|
||||
128 | And BarQuz too.
|
||||
| ^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:129:1
|
||||
|
|
||||
129 | be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
|
||||
--> $DIR/doc.rs:140:5
|
||||
|
|
||||
140 | /// be_sure_we_got_to_the_end_of_it
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
|
||||
--> $DIR/doc.rs:167:13
|
||||
|
|
||||
167 | /// Not ok: http://www.unicode.org/
|
||||
167 | /// Not ok: http://www.unicode.org
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
|
||||
--> $DIR/doc.rs:168:13
|
||||
|
|
||||
168 | /// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels
|
||||
168 | /// Not ok: https://www.unicode.org
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
|
||||
--> $DIR/doc.rs:169:13
|
||||
|
|
||||
169 | /// Not ok: http://www.unicode.org/
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: you should put bare URLs between `<`/`>` or make a proper Markdown link
|
||||
--> $DIR/doc.rs:170:13
|
||||
|
|
||||
170 | /// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 30 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: This binary expression can be simplified
|
|||
4 | if x == y || x < y {
|
||||
| ^^^^^^^^^^^^^^^ help: try: `x <= y`
|
||||
|
|
||||
= note: `-D double-comparisons` implied by `-D warnings`
|
||||
= note: `-D clippy::double-comparisons` implied by `-D warnings`
|
||||
|
||||
error: This binary expression can be simplified
|
||||
--> $DIR/double_comparison.rs:7:8
|
||||
|
|
|
@ -4,7 +4,7 @@ error: `--x` could be misinterpreted as pre-decrement by C programmers, is usual
|
|||
9 | --x;
|
||||
| ^^^
|
||||
|
|
||||
= note: `-D double-neg` implied by `-D warnings`
|
||||
= note: `-D clippy::double-neg` implied by `-D warnings`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ error: Consider removing unnecessary double parentheses
|
|||
16 | ((0))
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `-D double-parens` implied by `-D warnings`
|
||||
= note: `-D clippy::double-parens` implied by `-D warnings`
|
||||
|
||||
error: Consider removing unnecessary double parentheses
|
||||
--> $DIR/double_parens.rs:20:14
|
||||
|
|
|
@ -4,7 +4,7 @@ error: calls to `std::mem::drop` with a value that implements Copy. Dropping a c
|
|||
33 | drop(s1);
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: `-D drop-copy` implied by `-D warnings`
|
||||
= note: `-D clippy::drop-copy` implied by `-D warnings`
|
||||
note: argument has type SomeStruct
|
||||
--> $DIR/drop_forget_copy.rs:33:10
|
||||
|
|
||||
|
@ -41,7 +41,7 @@ error: calls to `std::mem::forget` with a value that implements Copy. Forgetting
|
|||
39 | forget(s1);
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `-D forget-copy` implied by `-D warnings`
|
||||
= note: `-D clippy::forget-copy` implied by `-D warnings`
|
||||
note: argument has type SomeStruct
|
||||
--> $DIR/drop_forget_copy.rs:39:12
|
||||
|
|
||||
|
|
|
@ -4,7 +4,7 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro
|
|||
12 | drop(&SomeStruct);
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D drop-ref` implied by `-D warnings`
|
||||
= note: `-D clippy::drop-ref` implied by `-D warnings`
|
||||
note: argument has type &SomeStruct
|
||||
--> $DIR/drop_forget_ref.rs:12:10
|
||||
|
|
||||
|
@ -17,7 +17,7 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F
|
|||
13 | forget(&SomeStruct);
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D forget-ref` implied by `-D warnings`
|
||||
= note: `-D clippy::forget-ref` implied by `-D warnings`
|
||||
note: argument has type &SomeStruct
|
||||
--> $DIR/drop_forget_ref.rs:13:12
|
||||
|
|
||||
|
|
|
@ -4,7 +4,7 @@ error: `darth` already exists, having another argument having almost the same na
|
|||
7 | fn join_the_dark_side(darth: i32, _darth: i32) {}
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `-D duplicate-underscore-argument` implied by `-D warnings`
|
||||
= note: `-D clippy::duplicate-underscore-argument` implied by `-D warnings`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
error: Calling `subsec_millis()` is more concise than this calculation
|
||||
--> $DIR/duration_subsec.rs:8:24
|
||||
|
|
||||
8 | let bad_millis_1 = dur.subsec_micros() / 1_000;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
|
||||
|
|
||||
= note: `-D duration-subsec` implied by `-D warnings`
|
||||
--> $DIR/duration_subsec.rs:10:24
|
||||
|
|
||||
10 | let bad_millis_1 = dur.subsec_micros() / 1_000;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
|
||||
|
|
||||
= note: `-D clippy::duration-subsec` implied by `-D warnings`
|
||||
|
||||
error: Calling `subsec_millis()` is more concise than this calculation
|
||||
--> $DIR/duration_subsec.rs:9:24
|
||||
|
|
||||
9 | let bad_millis_2 = dur.subsec_nanos() / 1_000_000;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
|
||||
--> $DIR/duration_subsec.rs:11:24
|
||||
|
|
||||
11 | let bad_millis_2 = dur.subsec_nanos() / 1_000_000;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
|
||||
|
||||
error: Calling `subsec_micros()` is more concise than this calculation
|
||||
--> $DIR/duration_subsec.rs:14:22
|
||||
--> $DIR/duration_subsec.rs:16:22
|
||||
|
|
||||
14 | let bad_micros = dur.subsec_nanos() / 1_000;
|
||||
16 | let bad_micros = dur.subsec_nanos() / 1_000;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_micros()`
|
||||
|
||||
error: Calling `subsec_micros()` is more concise than this calculation
|
||||
--> $DIR/duration_subsec.rs:19:13
|
||||
--> $DIR/duration_subsec.rs:21:13
|
||||
|
|
||||
19 | let _ = (&dur).subsec_nanos() / 1_000;
|
||||
21 | let _ = (&dur).subsec_nanos() / 1_000;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&dur).subsec_micros()`
|
||||
|
||||
error: Calling `subsec_micros()` is more concise than this calculation
|
||||
--> $DIR/duration_subsec.rs:23:13
|
||||
--> $DIR/duration_subsec.rs:25:13
|
||||
|
|
||||
23 | let _ = dur.subsec_nanos() / NANOS_IN_MICRO;
|
||||
25 | let _ = dur.subsec_nanos() / NANOS_IN_MICRO;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_micros()`
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
error: if expression with an `else if`, but without a final `else`
|
||||
--> $DIR/else_if_without_else.rs:39:12
|
||||
--> $DIR/else_if_without_else.rs:41:12
|
||||
|
|
||||
39 | } else if bla2() { //~ ERROR else if without else
|
||||
41 | } else if bla2() { //~ ERROR else if without else
|
||||
| ____________^
|
||||
40 | | println!("else if");
|
||||
41 | | }
|
||||
42 | | println!("else if");
|
||||
43 | | }
|
||||
| |_____^ help: add an `else` block here
|
||||
|
|
||||
= note: `-D else-if-without-else` implied by `-D warnings`
|
||||
= note: `-D clippy::else-if-without-else` implied by `-D warnings`
|
||||
|
||||
error: if expression with an `else if`, but without a final `else`
|
||||
--> $DIR/else_if_without_else.rs:47:12
|
||||
--> $DIR/else_if_without_else.rs:49:12
|
||||
|
|
||||
47 | } else if bla3() { //~ ERROR else if without else
|
||||
49 | } else if bla3() { //~ ERROR else if without else
|
||||
| ____________^
|
||||
48 | | println!("else if 2");
|
||||
49 | | }
|
||||
50 | | println!("else if 2");
|
||||
51 | | }
|
||||
| |_____^ help: add an `else` block here
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: enum with no variants
|
|||
7 | enum Empty {}
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D empty-enum` implied by `-D warnings`
|
||||
= note: `-D clippy::empty-enum` implied by `-D warnings`
|
||||
help: consider using the uninhabited type `!` or a wrapper around it
|
||||
--> $DIR/empty_enum.rs:7:1
|
||||
|
|
||||
|
|
|
@ -7,7 +7,7 @@ error: Found an empty line after an outer attribute. Perhaps you forgot to add a
|
|||
8 | | fn with_one_newline_and_comment() { assert!(true) }
|
||||
| |_
|
||||
|
|
||||
= note: `-D empty-line-after-outer-attr` implied by `-D warnings`
|
||||
= note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
|
||||
|
||||
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
|
||||
--> $DIR/empty_line_after_outer_attribute.rs:17:1
|
||||
|
|
|
@ -4,7 +4,7 @@ error: usage of `contains_key` followed by `insert` on a `HashMap`
|
|||
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`
|
||||
= note: `-D clippy::map-entry` implied by `-D warnings`
|
||||
|
||||
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
||||
--> $DIR/entry.rs:17:5
|
||||
|
|
|
@ -4,7 +4,7 @@ error: don't use glob imports for enum variants
|
|||
6 | use std::cmp::Ordering::*;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D enum-glob-use` implied by `-D warnings`
|
||||
= note: `-D clippy::enum-glob-use` implied by `-D warnings`
|
||||
|
||||
error: don't use glob imports for enum variants
|
||||
--> $DIR/enum_glob_use.rs:12:1
|
||||
|
|
|
@ -1,100 +1,100 @@
|
|||
error: Variant name ends with the enum's name
|
||||
--> $DIR/enum_variants.rs:14:5
|
||||
--> $DIR/enum_variants.rs:16:5
|
||||
|
|
||||
14 | cFoo,
|
||||
16 | cFoo,
|
||||
| ^^^^
|
||||
|
|
||||
= note: `-D enum-variant-names` implied by `-D warnings`
|
||||
|
||||
error: Variant name starts with the enum's name
|
||||
--> $DIR/enum_variants.rs:25:5
|
||||
|
|
||||
25 | FoodGood,
|
||||
| ^^^^^^^^
|
||||
|
||||
error: Variant name starts with the enum's name
|
||||
--> $DIR/enum_variants.rs:26:5
|
||||
|
|
||||
26 | FoodMiddle,
|
||||
| ^^^^^^^^^^
|
||||
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
|
||||
|
||||
error: Variant name starts with the enum's name
|
||||
--> $DIR/enum_variants.rs:27:5
|
||||
|
|
||||
27 | FoodBad,
|
||||
27 | FoodGood,
|
||||
| ^^^^^^^^
|
||||
|
||||
error: Variant name starts with the enum's name
|
||||
--> $DIR/enum_variants.rs:28:5
|
||||
|
|
||||
28 | FoodMiddle,
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: Variant name starts with the enum's name
|
||||
--> $DIR/enum_variants.rs:29:5
|
||||
|
|
||||
29 | FoodBad,
|
||||
| ^^^^^^^
|
||||
|
||||
error: All variants have the same prefix: `Food`
|
||||
--> $DIR/enum_variants.rs:24:1
|
||||
--> $DIR/enum_variants.rs:26:1
|
||||
|
|
||||
24 | / enum Food {
|
||||
25 | | FoodGood,
|
||||
26 | | FoodMiddle,
|
||||
27 | | FoodBad,
|
||||
28 | | }
|
||||
26 | / enum Food {
|
||||
27 | | FoodGood,
|
||||
28 | | FoodMiddle,
|
||||
29 | | FoodBad,
|
||||
30 | | }
|
||||
| |_^
|
||||
|
|
||||
= help: remove the prefixes and use full paths to the variants instead of glob imports
|
||||
|
||||
error: All variants have the same prefix: `CallType`
|
||||
--> $DIR/enum_variants.rs:34:1
|
||||
--> $DIR/enum_variants.rs:36:1
|
||||
|
|
||||
34 | / enum BadCallType {
|
||||
35 | | CallTypeCall,
|
||||
36 | | CallTypeCreate,
|
||||
37 | | CallTypeDestroy,
|
||||
38 | | }
|
||||
36 | / enum BadCallType {
|
||||
37 | | CallTypeCall,
|
||||
38 | | CallTypeCreate,
|
||||
39 | | CallTypeDestroy,
|
||||
40 | | }
|
||||
| |_^
|
||||
|
|
||||
= help: remove the prefixes and use full paths to the variants instead of glob imports
|
||||
|
||||
error: All variants have the same prefix: `Constant`
|
||||
--> $DIR/enum_variants.rs:45:1
|
||||
--> $DIR/enum_variants.rs:47:1
|
||||
|
|
||||
45 | / enum Consts {
|
||||
46 | | ConstantInt,
|
||||
47 | | ConstantCake,
|
||||
48 | | ConstantLie,
|
||||
49 | | }
|
||||
47 | / enum Consts {
|
||||
48 | | ConstantInt,
|
||||
49 | | ConstantCake,
|
||||
50 | | ConstantLie,
|
||||
51 | | }
|
||||
| |_^
|
||||
|
|
||||
= help: remove the prefixes and use full paths to the variants instead of glob imports
|
||||
|
||||
error: All variants have the same prefix: `With`
|
||||
--> $DIR/enum_variants.rs:78:1
|
||||
--> $DIR/enum_variants.rs:80:1
|
||||
|
|
||||
78 | / enum Seallll {
|
||||
79 | | WithOutCake,
|
||||
80 | | WithOutTea,
|
||||
81 | | WithOut,
|
||||
82 | | }
|
||||
80 | / enum Seallll {
|
||||
81 | | WithOutCake,
|
||||
82 | | WithOutTea,
|
||||
83 | | WithOut,
|
||||
84 | | }
|
||||
| |_^
|
||||
|
|
||||
= help: remove the prefixes and use full paths to the variants instead of glob imports
|
||||
|
||||
error: All variants have the same prefix: `Prefix`
|
||||
--> $DIR/enum_variants.rs:84:1
|
||||
--> $DIR/enum_variants.rs:86:1
|
||||
|
|
||||
84 | / enum NonCaps {
|
||||
85 | | Prefix的,
|
||||
86 | | PrefixTea,
|
||||
87 | | PrefixCake,
|
||||
88 | | }
|
||||
86 | / enum NonCaps {
|
||||
87 | | Prefix的,
|
||||
88 | | PrefixTea,
|
||||
89 | | PrefixCake,
|
||||
90 | | }
|
||||
| |_^
|
||||
|
|
||||
= help: remove the prefixes and use full paths to the variants instead of glob imports
|
||||
|
||||
error: All variants have the same prefix: `With`
|
||||
--> $DIR/enum_variants.rs:90:1
|
||||
--> $DIR/enum_variants.rs:92:1
|
||||
|
|
||||
90 | / pub enum PubSeall {
|
||||
91 | | WithOutCake,
|
||||
92 | | WithOutTea,
|
||||
93 | | WithOut,
|
||||
94 | | }
|
||||
92 | / pub enum PubSeall {
|
||||
93 | | WithOutCake,
|
||||
94 | | WithOutTea,
|
||||
95 | | WithOut,
|
||||
96 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D pub-enum-variant-names` implied by `-D warnings`
|
||||
= note: `-D clippy::pub-enum-variant-names` implied by `-D warnings`
|
||||
= help: remove the prefixes and use full paths to the variants instead of glob imports
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
|
|
@ -1,51 +1,51 @@
|
|||
error: Clike enum variant discriminant is not portable to 32-bit targets
|
||||
--> $DIR/enums_clike.rs:10:5
|
||||
--> $DIR/enums_clike.rs:12:5
|
||||
|
|
||||
10 | X = 0x1_0000_0000,
|
||||
12 | X = 0x1_0000_0000,
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D enum-clike-unportable-variant` implied by `-D warnings`
|
||||
= note: `-D clippy::enum-clike-unportable-variant` implied by `-D warnings`
|
||||
|
||||
error: Clike enum variant discriminant is not portable to 32-bit targets
|
||||
--> $DIR/enums_clike.rs:17:5
|
||||
--> $DIR/enums_clike.rs:19:5
|
||||
|
|
||||
17 | X = 0x1_0000_0000,
|
||||
19 | X = 0x1_0000_0000,
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: Clike enum variant discriminant is not portable to 32-bit targets
|
||||
--> $DIR/enums_clike.rs:20:5
|
||||
--> $DIR/enums_clike.rs:22:5
|
||||
|
|
||||
20 | A = 0xFFFF_FFFF,
|
||||
22 | A = 0xFFFF_FFFF,
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: Clike enum variant discriminant is not portable to 32-bit targets
|
||||
--> $DIR/enums_clike.rs:27:5
|
||||
--> $DIR/enums_clike.rs:29:5
|
||||
|
|
||||
27 | Z = 0xFFFF_FFFF,
|
||||
29 | Z = 0xFFFF_FFFF,
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: Clike enum variant discriminant is not portable to 32-bit targets
|
||||
--> $DIR/enums_clike.rs:28:5
|
||||
|
|
||||
28 | A = 0x1_0000_0000,
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: Clike enum variant discriminant is not portable to 32-bit targets
|
||||
--> $DIR/enums_clike.rs:30:5
|
||||
|
|
||||
30 | C = (std::i32::MIN as isize) - 1,
|
||||
30 | A = 0x1_0000_0000,
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: Clike enum variant discriminant is not portable to 32-bit targets
|
||||
--> $DIR/enums_clike.rs:32:5
|
||||
|
|
||||
32 | C = (std::i32::MIN as isize) - 1,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: Clike enum variant discriminant is not portable to 32-bit targets
|
||||
--> $DIR/enums_clike.rs:36:5
|
||||
--> $DIR/enums_clike.rs:38:5
|
||||
|
|
||||
36 | Z = 0xFFFF_FFFF,
|
||||
38 | Z = 0xFFFF_FFFF,
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: Clike enum variant discriminant is not portable to 32-bit targets
|
||||
--> $DIR/enums_clike.rs:37:5
|
||||
--> $DIR/enums_clike.rs:39:5
|
||||
|
|
||||
37 | A = 0x1_0000_0000,
|
||||
39 | A = 0x1_0000_0000,
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: this boolean expression can be simplified
|
|||
37 | true && true;
|
||||
| ^^^^^^^^^^^^ help: try: `true`
|
||||
|
|
||||
= note: `-D nonminimal-bool` implied by `-D warnings`
|
||||
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
|
||||
|
||||
error: this boolean expression can be simplified
|
||||
--> $DIR/eq_op.rs:39:5
|
||||
|
@ -42,7 +42,7 @@ error: equal expressions as operands to `==`
|
|||
10 | 1 == 1;
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `-D eq-op` implied by `-D warnings`
|
||||
= note: `-D clippy::eq-op` implied by `-D warnings`
|
||||
|
||||
error: equal expressions as operands to `==`
|
||||
--> $DIR/eq_op.rs:11:5
|
||||
|
@ -202,7 +202,7 @@ error: taken reference of right operand
|
|||
| |
|
||||
| help: use the right value directly: `y`
|
||||
|
|
||||
= note: `-D op-ref` implied by `-D warnings`
|
||||
= note: `-D clippy::op-ref` implied by `-D warnings`
|
||||
|
||||
error: equal expressions as operands to `/`
|
||||
--> $DIR/eq_op.rs:97:20
|
||||
|
|
|
@ -4,7 +4,7 @@ error: this operation will always return zero. This is likely not the intended o
|
|||
9 | x * 0;
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `-D erasing-op` implied by `-D warnings`
|
||||
= note: `-D clippy::erasing-op` implied by `-D warnings`
|
||||
|
||||
error: this operation will always return zero. This is likely not the intended outcome
|
||||
--> $DIR/erasing_op.rs:10:5
|
||||
|
|
|
@ -4,7 +4,7 @@ error: redundant closure found
|
|||
7 | let a = Some(1u8).map(|a| foo(a));
|
||||
| ^^^^^^^^^^ help: remove closure as shown: `foo`
|
||||
|
|
||||
= note: `-D redundant-closure` implied by `-D warnings`
|
||||
= note: `-D clippy::redundant-closure` implied by `-D warnings`
|
||||
|
||||
error: redundant closure found
|
||||
--> $DIR/eta.rs:8:10
|
||||
|
@ -24,7 +24,7 @@ error: this expression borrows a reference that is immediately dereferenced by t
|
|||
11 | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
|
||||
| ^^^ help: change this to: `&2`
|
||||
|
|
||||
= note: `-D needless-borrow` implied by `-D warnings`
|
||||
= note: `-D clippy::needless-borrow` implied by `-D warnings`
|
||||
|
||||
error: redundant closure found
|
||||
--> $DIR/eta.rs:18:27
|
||||
|
|
|
@ -4,7 +4,7 @@ error: unsequenced read of a variable
|
|||
8 | let a = { x = 1; 1 } + x;
|
||||
| ^
|
||||
|
|
||||
= note: `-D eval-order-dependence` implied by `-D warnings`
|
||||
= note: `-D clippy::eval-order-dependence` implied by `-D warnings`
|
||||
note: whether read occurs before this write depends on evaluation order
|
||||
--> $DIR/eval_order_dependence.rs:8:15
|
||||
|
|
||||
|
|
|
@ -4,7 +4,7 @@ error: float has excessive precision
|
|||
15 | const BAD32_1: f32 = 0.123_456_789_f32;
|
||||
| ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_79`
|
||||
|
|
||||
= note: `-D excessive-precision` implied by `-D warnings`
|
||||
= note: `-D clippy::excessive-precision` implied by `-D warnings`
|
||||
|
||||
error: float has excessive precision
|
||||
--> $DIR/excessive_precision.rs:16:26
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
error: use of `write!(stdout(), ...).unwrap()`. Consider using `print!` instead
|
||||
--> $DIR/explicit_write.rs:16:9
|
||||
--> $DIR/explicit_write.rs:18:9
|
||||
|
|
||||
16 | write!(std::io::stdout(), "test").unwrap();
|
||||
18 | write!(std::io::stdout(), "test").unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D explicit-write` implied by `-D warnings`
|
||||
= note: `-D clippy::explicit-write` implied by `-D warnings`
|
||||
|
||||
error: use of `write!(stderr(), ...).unwrap()`. Consider using `eprint!` instead
|
||||
--> $DIR/explicit_write.rs:17:9
|
||||
--> $DIR/explicit_write.rs:19:9
|
||||
|
|
||||
17 | write!(std::io::stderr(), "test").unwrap();
|
||||
19 | write!(std::io::stderr(), "test").unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: use of `writeln!(stdout(), ...).unwrap()`. Consider using `println!` instead
|
||||
--> $DIR/explicit_write.rs:18:9
|
||||
--> $DIR/explicit_write.rs:20:9
|
||||
|
|
||||
18 | writeln!(std::io::stdout(), "test").unwrap();
|
||||
20 | writeln!(std::io::stdout(), "test").unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: use of `writeln!(stderr(), ...).unwrap()`. Consider using `eprintln!` instead
|
||||
--> $DIR/explicit_write.rs:19:9
|
||||
--> $DIR/explicit_write.rs:21:9
|
||||
|
|
||||
19 | writeln!(std::io::stderr(), "test").unwrap();
|
||||
21 | writeln!(std::io::stderr(), "test").unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: use of `stdout().write_fmt(...).unwrap()`. Consider using `print!` instead
|
||||
--> $DIR/explicit_write.rs:20:9
|
||||
--> $DIR/explicit_write.rs:22:9
|
||||
|
|
||||
20 | std::io::stdout().write_fmt(format_args!("test")).unwrap();
|
||||
22 | std::io::stdout().write_fmt(format_args!("test")).unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: use of `stderr().write_fmt(...).unwrap()`. Consider using `eprint!` instead
|
||||
--> $DIR/explicit_write.rs:21:9
|
||||
--> $DIR/explicit_write.rs:23:9
|
||||
|
|
||||
21 | std::io::stderr().write_fmt(format_args!("test")).unwrap();
|
||||
23 | std::io::stderr().write_fmt(format_args!("test")).unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
|
|
@ -1,91 +1,91 @@
|
|||
error: consider implementing `TryFrom` instead
|
||||
--> $DIR/fallible_impl_from.rs:5:1
|
||||
|
|
||||
5 | / impl From<String> for Foo {
|
||||
6 | | fn from(s: String) -> Self {
|
||||
7 | | Foo(s.parse().unwrap())
|
||||
8 | | }
|
||||
9 | | }
|
||||
| |_^
|
||||
|
|
||||
--> $DIR/fallible_impl_from.rs:7:1
|
||||
|
|
||||
7 | / impl From<String> for Foo {
|
||||
8 | | fn from(s: String) -> Self {
|
||||
9 | | Foo(s.parse().unwrap())
|
||||
10 | | }
|
||||
11 | | }
|
||||
| |_^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/fallible_impl_from.rs:1:9
|
||||
|
|
||||
1 | #![deny(fallible_impl_from)]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
|
||||
--> $DIR/fallible_impl_from.rs:3:9
|
||||
|
|
||||
3 | #![deny(clippy::fallible_impl_from)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
|
||||
note: potential failure(s)
|
||||
--> $DIR/fallible_impl_from.rs:7:13
|
||||
|
|
||||
7 | Foo(s.parse().unwrap())
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
--> $DIR/fallible_impl_from.rs:9:13
|
||||
|
|
||||
9 | Foo(s.parse().unwrap())
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: consider implementing `TryFrom` instead
|
||||
--> $DIR/fallible_impl_from.rs:28:1
|
||||
--> $DIR/fallible_impl_from.rs:30:1
|
||||
|
|
||||
28 | / impl From<usize> for Invalid {
|
||||
29 | | fn from(i: usize) -> Invalid {
|
||||
30 | | if i != 42 {
|
||||
31 | | panic!();
|
||||
30 | / impl From<usize> for Invalid {
|
||||
31 | | fn from(i: usize) -> Invalid {
|
||||
32 | | if i != 42 {
|
||||
33 | | panic!();
|
||||
... |
|
||||
34 | | }
|
||||
35 | | }
|
||||
36 | | }
|
||||
37 | | }
|
||||
| |_^
|
||||
|
|
||||
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
|
||||
note: potential failure(s)
|
||||
--> $DIR/fallible_impl_from.rs:31:13
|
||||
--> $DIR/fallible_impl_from.rs:33:13
|
||||
|
|
||||
31 | panic!();
|
||||
33 | panic!();
|
||||
| ^^^^^^^^^
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: consider implementing `TryFrom` instead
|
||||
--> $DIR/fallible_impl_from.rs:37:1
|
||||
--> $DIR/fallible_impl_from.rs:39:1
|
||||
|
|
||||
37 | / impl From<Option<String>> for Invalid {
|
||||
38 | | fn from(s: Option<String>) -> Invalid {
|
||||
39 | | let s = s.unwrap();
|
||||
40 | | if !s.is_empty() {
|
||||
39 | / impl From<Option<String>> for Invalid {
|
||||
40 | | fn from(s: Option<String>) -> Invalid {
|
||||
41 | | let s = s.unwrap();
|
||||
42 | | if !s.is_empty() {
|
||||
... |
|
||||
46 | | }
|
||||
47 | | }
|
||||
48 | | }
|
||||
49 | | }
|
||||
| |_^
|
||||
|
|
||||
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
|
||||
note: potential failure(s)
|
||||
--> $DIR/fallible_impl_from.rs:39:17
|
||||
--> $DIR/fallible_impl_from.rs:41:17
|
||||
|
|
||||
39 | let s = s.unwrap();
|
||||
41 | let s = s.unwrap();
|
||||
| ^^^^^^^^^^
|
||||
40 | if !s.is_empty() {
|
||||
41 | panic!(42);
|
||||
42 | if !s.is_empty() {
|
||||
43 | panic!(42);
|
||||
| ^^^^^^^^^^^
|
||||
42 | } else if s.parse::<u32>().unwrap() != 42 {
|
||||
44 | } else if s.parse::<u32>().unwrap() != 42 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
43 | panic!("{:?}", s);
|
||||
45 | panic!("{:?}", s);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: consider implementing `TryFrom` instead
|
||||
--> $DIR/fallible_impl_from.rs:55:1
|
||||
--> $DIR/fallible_impl_from.rs:57:1
|
||||
|
|
||||
55 | / impl<'a> From<&'a mut <Box<u32> as ProjStrTrait>::ProjString> for Invalid {
|
||||
56 | | fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
|
||||
57 | | if s.parse::<u32>().ok().unwrap() != 42 {
|
||||
58 | | panic!("{:?}", s);
|
||||
57 | / impl<'a> From<&'a mut <Box<u32> as ProjStrTrait>::ProjString> for Invalid {
|
||||
58 | | fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
|
||||
59 | | if s.parse::<u32>().ok().unwrap() != 42 {
|
||||
60 | | panic!("{:?}", s);
|
||||
... |
|
||||
61 | | }
|
||||
62 | | }
|
||||
63 | | }
|
||||
64 | | }
|
||||
| |_^
|
||||
|
|
||||
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
|
||||
note: potential failure(s)
|
||||
--> $DIR/fallible_impl_from.rs:57:12
|
||||
--> $DIR/fallible_impl_from.rs:59:12
|
||||
|
|
||||
57 | if s.parse::<u32>().ok().unwrap() != 42 {
|
||||
59 | if s.parse::<u32>().ok().unwrap() != 42 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
58 | panic!("{:?}", s);
|
||||
60 | panic!("{:?}", s);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ error: called `filter(p).map(q)` on an `Iterator`. This is more succinctly expre
|
|||
10 | | .map(|x| x * 2)
|
||||
| |_____________________________________________^
|
||||
|
|
||||
= note: `-D filter-map` implied by `-D warnings`
|
||||
= note: `-D clippy::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.
|
||||
--> $DIR/filter_methods.rs:13:21
|
||||
|
|
|
@ -4,7 +4,7 @@ error: strict comparison of f32 or f64
|
|||
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: `-D clippy::float-cmp` implied by `-D warnings`
|
||||
note: std::f32::EPSILON and std::f64::EPSILON are available.
|
||||
--> $DIR/float_cmp.rs:49:5
|
||||
|
|
||||
|
|
|
@ -4,7 +4,7 @@ error: strict comparison of f32 or f64 constant
|
|||
17 | 1f32 == ONE;
|
||||
| ^^^^^^^^^^^ help: consider comparing them within some error: `(1f32 - ONE).abs() < error`
|
||||
|
|
||||
= note: `-D float-cmp-const` implied by `-D warnings`
|
||||
= note: `-D clippy::float-cmp-const` implied by `-D warnings`
|
||||
note: std::f32::EPSILON and std::f64::EPSILON are available.
|
||||
--> $DIR/float_cmp_const.rs:17:5
|
||||
|
|
||||
|
|
|
@ -4,7 +4,7 @@ error: for loop over `option`, which is an `Option`. This is more readably writt
|
|||
17 | for x in option {
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `-D for-loop-over-option` implied by `-D warnings`
|
||||
= note: `-D clippy::for-loop-over-option` implied by `-D warnings`
|
||||
= 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.
|
||||
|
@ -13,7 +13,7 @@ error: for loop over `result`, which is a `Result`. This is more readably writte
|
|||
22 | for x in result {
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `-D for-loop-over-result` implied by `-D warnings`
|
||||
= note: `-D clippy::for-loop-over-result` implied by `-D warnings`
|
||||
= 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.
|
||||
|
@ -30,7 +30,7 @@ error: you are iterating over `Iterator::next()` which is an Option; this will c
|
|||
32 | for x in v.iter().next() {
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D iter-next-loop` implied by `-D warnings`
|
||||
= note: `-D clippy::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.
|
||||
--> $DIR/for_loop.rs:37:14
|
||||
|
@ -57,7 +57,7 @@ error: this loop never actually loops
|
|||
56 | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: `-D never-loop` implied by `-D warnings`
|
||||
= note: `-D clippy::never-loop` implied by `-D warnings`
|
||||
|
||||
error: this loop never actually loops
|
||||
--> $DIR/for_loop.rs:59:5
|
||||
|
@ -74,7 +74,7 @@ error: the loop variable `i` is only used to index `vec`.
|
|||
86 | for i in 0..vec.len() {
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D needless-range-loop` implied by `-D warnings`
|
||||
= note: `-D clippy::needless-range-loop` implied by `-D warnings`
|
||||
help: consider using an iterator
|
||||
|
|
||||
86 | for <item> in &vec {
|
||||
|
@ -206,7 +206,7 @@ error: this range is empty so this for loop will never run
|
|||
148 | for i in 10..0 {
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `-D reverse-range-loop` implied by `-D warnings`
|
||||
= note: `-D clippy::reverse-range-loop` implied by `-D warnings`
|
||||
help: consider using the following if you are attempting to iterate over this range in reverse
|
||||
|
|
||||
148 | for i in (0..10).rev() {
|
||||
|
@ -270,7 +270,7 @@ error: it is more idiomatic to loop over references to containers instead of usi
|
|||
215 | for _v in vec.iter() {}
|
||||
| ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
|
||||
|
|
||||
= note: `-D explicit-iter-loop` implied by `-D warnings`
|
||||
= note: `-D clippy::explicit-iter-loop` implied by `-D warnings`
|
||||
|
||||
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
||||
--> $DIR/for_loop.rs:217:15
|
||||
|
@ -284,7 +284,7 @@ error: it is more idiomatic to loop over containers instead of using explicit it
|
|||
220 | 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`
|
||||
= note: `-D clippy::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
|
||||
--> $DIR/for_loop.rs:223:15
|
||||
|
@ -358,7 +358,7 @@ error: you are collect()ing an iterator and throwing away the result. Consider u
|
|||
264 | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D unused-collect` implied by `-D warnings`
|
||||
= note: `-D clippy::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
|
||||
--> $DIR/for_loop.rs:269:15
|
||||
|
@ -366,7 +366,7 @@ error: the variable `_index` is used as a loop counter. Consider using `for (_in
|
|||
269 | for _v in &vec {
|
||||
| ^^^^
|
||||
|
|
||||
= note: `-D explicit-counter-loop` implied by `-D warnings`
|
||||
= note: `-D clippy::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
|
||||
--> $DIR/for_loop.rs:275:15
|
||||
|
@ -380,7 +380,7 @@ error: you seem to want to iterate on a map's values
|
|||
385 | for (_, v) in &m {
|
||||
| ^^
|
||||
|
|
||||
= note: `-D for-kv-map` implied by `-D warnings`
|
||||
= note: `-D clippy::for-kv-map` implied by `-D warnings`
|
||||
help: use the corresponding method
|
||||
|
|
||||
385 | for v in m.values() {
|
||||
|
@ -432,7 +432,7 @@ error: it looks like you're manually copying between slices
|
|||
462 | for i in 0..src.len() {
|
||||
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
|
||||
|
|
||||
= note: `-D manual-memcpy` implied by `-D warnings`
|
||||
= note: `-D clippy::manual-memcpy` implied by `-D warnings`
|
||||
|
||||
error: it looks like you're manually copying between slices
|
||||
--> $DIR/for_loop.rs:467:14
|
||||
|
|
|
@ -4,7 +4,7 @@ error: useless use of `format!`
|
|||
12 | format!("foo");
|
||||
| ^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string()`
|
||||
|
|
||||
= note: `-D useless-format` implied by `-D warnings`
|
||||
= note: `-D clippy::useless-format` implied by `-D warnings`
|
||||
|
||||
error: useless use of `format!`
|
||||
--> $DIR/format.rs:14:5
|
||||
|
|
|
@ -4,7 +4,7 @@ error: this looks like an `else if` but the `else` is missing
|
|||
15 | } if foo() {
|
||||
| ^
|
||||
|
|
||||
= note: `-D suspicious-else-formatting` implied by `-D warnings`
|
||||
= note: `-D clippy::suspicious-else-formatting` implied by `-D warnings`
|
||||
= 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
|
||||
|
@ -50,7 +50,7 @@ error: this looks like you are trying to use `.. -= ..`, but you really are doin
|
|||
71 | a =- 35;
|
||||
| ^^^^
|
||||
|
|
||||
= note: `-D suspicious-assignment-formatting` implied by `-D warnings`
|
||||
= note: `-D clippy::suspicious-assignment-formatting` implied by `-D warnings`
|
||||
= note: to remove this lint, use either `-=` or `= -`
|
||||
|
||||
error: this looks like you are trying to use `.. *= ..`, but you really are doing `.. = (* ..)`
|
||||
|
@ -75,7 +75,7 @@ error: possibly missing a comma here
|
|||
84 | -1, -2, -3 // <= no comma here
|
||||
| ^
|
||||
|
|
||||
= note: `-D possible-missing-comma` implied by `-D warnings`
|
||||
= note: `-D clippy::possible-missing-comma` implied by `-D warnings`
|
||||
= note: to remove this lint, add a comma or write the expr in a single line
|
||||
|
||||
error: possibly missing a comma here
|
||||
|
|
|
@ -5,7 +5,7 @@ error: this function has too many arguments (8/7)
|
|||
12 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D too-many-arguments` implied by `-D warnings`
|
||||
= note: `-D clippy::too-many-arguments` implied by `-D warnings`
|
||||
|
||||
error: this function has too many arguments (8/7)
|
||||
--> $DIR/functions.rs:19:5
|
||||
|
@ -25,7 +25,7 @@ error: this public function dereferences a raw pointer but is not marked `unsafe
|
|||
37 | println!("{}", unsafe { *p });
|
||||
| ^
|
||||
|
|
||||
= note: `-D not-unsafe-ptr-arg-deref` implied by `-D warnings`
|
||||
= note: `-D clippy::not-unsafe-ptr-arg-deref` implied by `-D warnings`
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:38:35
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
error: Prefer FxHashMap over HashMap, it has better performance and we don't need any collision prevention in clippy
|
||||
--> $DIR/fxhash.rs:6:24
|
||||
--> $DIR/fxhash.rs:8:24
|
||||
|
|
||||
6 | use std::collections::{HashMap, HashSet};
|
||||
8 | use std::collections::{HashMap, HashSet};
|
||||
| ^^^^^^^ help: use: `FxHashMap`
|
||||
|
|
||||
= note: `-D default-hash-types` implied by `-D warnings`
|
||||
= note: `-D clippy::default-hash-types` implied by `-D warnings`
|
||||
|
||||
error: Prefer FxHashSet over HashSet, it has better performance and we don't need any collision prevention in clippy
|
||||
--> $DIR/fxhash.rs:6:33
|
||||
--> $DIR/fxhash.rs:8:33
|
||||
|
|
||||
6 | use std::collections::{HashMap, HashSet};
|
||||
8 | use std::collections::{HashMap, HashSet};
|
||||
| ^^^^^^^ help: use: `FxHashSet`
|
||||
|
||||
error: Prefer FxHashMap over HashMap, it has better performance and we don't need any collision prevention in clippy
|
||||
--> $DIR/fxhash.rs:10:15
|
||||
--> $DIR/fxhash.rs:12:15
|
||||
|
|
||||
10 | let _map: HashMap<String, String> = HashMap::default();
|
||||
12 | let _map: HashMap<String, String> = HashMap::default();
|
||||
| ^^^^^^^ help: use: `FxHashMap`
|
||||
|
||||
error: Prefer FxHashMap over HashMap, it has better performance and we don't need any collision prevention in clippy
|
||||
--> $DIR/fxhash.rs:10:41
|
||||
--> $DIR/fxhash.rs:12:41
|
||||
|
|
||||
10 | let _map: HashMap<String, String> = HashMap::default();
|
||||
12 | let _map: HashMap<String, String> = HashMap::default();
|
||||
| ^^^^^^^ help: use: `FxHashMap`
|
||||
|
||||
error: Prefer FxHashSet over HashSet, it has better performance and we don't need any collision prevention in clippy
|
||||
--> $DIR/fxhash.rs:11:15
|
||||
--> $DIR/fxhash.rs:13:15
|
||||
|
|
||||
11 | let _set: HashSet<String> = HashSet::default();
|
||||
13 | let _set: HashSet<String> = HashSet::default();
|
||||
| ^^^^^^^ help: use: `FxHashSet`
|
||||
|
||||
error: Prefer FxHashSet over HashSet, it has better performance and we don't need any collision prevention in clippy
|
||||
--> $DIR/fxhash.rs:11:33
|
||||
--> $DIR/fxhash.rs:13:33
|
||||
|
|
||||
11 | let _set: HashSet<String> = HashSet::default();
|
||||
13 | let _set: HashSet<String> = HashSet::default();
|
||||
| ^^^^^^^ help: use: `FxHashSet`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more co
|
|||
27 | let _ = boxed_slice.get(1).unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
|
||||
|
|
||||
= note: `-D get-unwrap` implied by `-D warnings`
|
||||
= note: `-D clippy::get-unwrap` implied by `-D warnings`
|
||||
|
||||
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
|
||||
--> $DIR/get_unwrap.rs:28:17
|
||||
|
|
|
@ -1,61 +1,61 @@
|
|||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:4:13
|
||||
--> $DIR/identity_conversion.rs:6:13
|
||||
|
|
||||
4 | let _ = T::from(val);
|
||||
6 | let _ = T::from(val);
|
||||
| ^^^^^^^^^^^^ help: consider removing `T::from()`: `val`
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/identity_conversion.rs:1:9
|
||||
--> $DIR/identity_conversion.rs:3:9
|
||||
|
|
||||
1 | #![deny(identity_conversion)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
3 | #![deny(clippy::identity_conversion)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:5:5
|
||||
--> $DIR/identity_conversion.rs:7:5
|
||||
|
|
||||
5 | val.into()
|
||||
7 | val.into()
|
||||
| ^^^^^^^^^^ help: consider removing `.into()`: `val`
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:17:22
|
||||
--> $DIR/identity_conversion.rs:19:22
|
||||
|
|
||||
17 | let _: i32 = 0i32.into();
|
||||
19 | let _: i32 = 0i32.into();
|
||||
| ^^^^^^^^^^^ help: consider removing `.into()`: `0i32`
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:38:21
|
||||
--> $DIR/identity_conversion.rs:40:21
|
||||
|
|
||||
38 | let _: String = "foo".to_string().into();
|
||||
40 | let _: String = "foo".to_string().into();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:39:21
|
||||
--> $DIR/identity_conversion.rs:41:21
|
||||
|
|
||||
39 | let _: String = From::from("foo".to_string());
|
||||
41 | let _: String = From::from("foo".to_string());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:40:13
|
||||
|
|
||||
40 | let _ = String::from("foo".to_string());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:41:13
|
||||
|
|
||||
41 | let _ = String::from(format!("A: {:04}", 123));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("A: {:04}", 123)`
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:42:13
|
||||
|
|
||||
42 | let _ = "".lines().into_iter();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `"".lines()`
|
||||
42 | let _ = String::from("foo".to_string());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:43:13
|
||||
|
|
||||
43 | let _ = vec![1, 2, 3].into_iter().into_iter();
|
||||
43 | let _ = String::from(format!("A: {:04}", 123));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("A: {:04}", 123)`
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:44:13
|
||||
|
|
||||
44 | let _ = "".lines().into_iter();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `"".lines()`
|
||||
|
||||
error: identical conversion
|
||||
--> $DIR/identity_conversion.rs:45:13
|
||||
|
|
||||
45 | let _ = vec![1, 2, 3].into_iter().into_iter();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![1, 2, 3].into_iter()`
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: the operation is ineffective. Consider reducing it to `x`
|
|||
13 | x + 0;
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `-D identity-op` implied by `-D warnings`
|
||||
= note: `-D clippy::identity-op` implied by `-D warnings`
|
||||
|
||||
error: the operation is ineffective. Consider reducing it to `x`
|
||||
--> $DIR/identity_op.rs:14:5
|
||||
|
|
|
@ -4,7 +4,7 @@ error: redundant pattern matching, consider using `is_ok()`
|
|||
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`
|
||||
= note: `-D clippy::if-let-redundant-pattern-matching` implied by `-D warnings`
|
||||
|
||||
error: redundant pattern matching, consider using `is_err()`
|
||||
--> $DIR/if_let_redundant_pattern_matching.rs:11:12
|
||||
|
|
|
@ -8,7 +8,7 @@ error: Unnecessary boolean `not` operation
|
|||
13 | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: `-D if-not-else` implied by `-D warnings`
|
||||
= note: `-D clippy::if-not-else` implied by `-D warnings`
|
||||
= help: remove the `!` and swap the blocks of the if/else
|
||||
|
||||
error: Unnecessary `!=` operation
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
error: Multiple implementations of this structure
|
||||
--> $DIR/impl.rs:10:1
|
||||
--> $DIR/impl.rs:12:1
|
||||
|
|
||||
10 | / impl MyStruct {
|
||||
11 | | fn second() {}
|
||||
12 | | }
|
||||
12 | / impl MyStruct {
|
||||
13 | | fn second() {}
|
||||
14 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D multiple-inherent-impl` implied by `-D warnings`
|
||||
= note: `-D clippy::multiple-inherent-impl` implied by `-D warnings`
|
||||
note: First implementation here
|
||||
--> $DIR/impl.rs:6:1
|
||||
--> $DIR/impl.rs:8:1
|
||||
|
|
||||
6 | / impl MyStruct {
|
||||
7 | | fn first() {}
|
||||
8 | | }
|
||||
8 | / impl MyStruct {
|
||||
9 | | fn first() {}
|
||||
10 | | }
|
||||
| |_^
|
||||
|
||||
error: Multiple implementations of this structure
|
||||
--> $DIR/impl.rs:24:5
|
||||
--> $DIR/impl.rs:26:5
|
||||
|
|
||||
24 | / impl super::MyStruct {
|
||||
25 | | fn third() {}
|
||||
26 | | }
|
||||
26 | / impl super::MyStruct {
|
||||
27 | | fn third() {}
|
||||
28 | | }
|
||||
| |_____^
|
||||
|
|
||||
note: First implementation here
|
||||
--> $DIR/impl.rs:6:1
|
||||
--> $DIR/impl.rs:8:1
|
||||
|
|
||||
6 | / impl MyStruct {
|
||||
7 | | fn first() {}
|
||||
8 | | }
|
||||
8 | / impl MyStruct {
|
||||
9 | | fn first() {}
|
||||
10 | | }
|
||||
| |_^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: impl for `HashMap` should be generalized over different hashers
|
|||
11 | impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> {
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D implicit-hasher` implied by `-D warnings`
|
||||
= note: `-D clippy::implicit-hasher` implied by `-D warnings`
|
||||
help: consider adding a type parameter
|
||||
|
|
||||
11 | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashMap<K, V, S> {
|
||||
|
|
|
@ -4,7 +4,7 @@ error: digits grouped inconsistently by underscores
|
|||
7 | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
|
||||
| ^^^^^^^^ help: consider: `123_456`
|
||||
|
|
||||
= note: `-D inconsistent-digit-grouping` implied by `-D warnings`
|
||||
= note: `-D clippy::inconsistent-digit-grouping` implied by `-D warnings`
|
||||
|
||||
error: digits grouped inconsistently by underscores
|
||||
--> $DIR/inconsistent_digit_grouping.rs:7:26
|
||||
|
|
|
@ -1,268 +1,268 @@
|
|||
error: indexing may panic.
|
||||
--> $DIR/indexing_slicing.rs:11:5
|
||||
--> $DIR/indexing_slicing.rs:13:5
|
||||
|
|
||||
11 | x[index];
|
||||
13 | x[index];
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: `-D indexing-slicing` implied by `-D warnings`
|
||||
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
|
||||
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:12:6
|
||||
--> $DIR/indexing_slicing.rs:14:6
|
||||
|
|
||||
12 | &x[index..];
|
||||
14 | &x[index..];
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:13:6
|
||||
--> $DIR/indexing_slicing.rs:15:6
|
||||
|
|
||||
13 | &x[..index];
|
||||
15 | &x[..index];
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:14:6
|
||||
--> $DIR/indexing_slicing.rs:16:6
|
||||
|
|
||||
14 | &x[index_from..index_to];
|
||||
16 | &x[index_from..index_to];
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:15:6
|
||||
--> $DIR/indexing_slicing.rs:17:6
|
||||
|
|
||||
15 | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
|
||||
17 | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:15:6
|
||||
--> $DIR/indexing_slicing.rs:17:6
|
||||
|
|
||||
15 | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
|
||||
17 | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:18:6
|
||||
--> $DIR/indexing_slicing.rs:20:6
|
||||
|
|
||||
18 | &x[..=4];
|
||||
20 | &x[..=4];
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
|
||||
= note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:19:6
|
||||
--> $DIR/indexing_slicing.rs:21:6
|
||||
|
|
||||
19 | &x[1..5];
|
||||
21 | &x[1..5];
|
||||
| ^^^^^^^
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:20:6
|
||||
--> $DIR/indexing_slicing.rs:22:6
|
||||
|
|
||||
20 | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
|
||||
22 | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:20:6
|
||||
|
|
||||
20 | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
|
||||
| ^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:21:6
|
||||
|
|
||||
21 | &x[5..];
|
||||
| ^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:22:6
|
||||
|
|
||||
22 | &x[..5];
|
||||
22 | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
|
||||
| ^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:23:6
|
||||
|
|
||||
23 | &x[5..].iter().map(|x| 2 * x).collect::<Vec<i32>>();
|
||||
23 | &x[5..];
|
||||
| ^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:24:6
|
||||
|
|
||||
24 | &x[0..=4];
|
||||
24 | &x[..5];
|
||||
| ^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:25:6
|
||||
|
|
||||
25 | &x[5..].iter().map(|x| 2 * x).collect::<Vec<i32>>();
|
||||
| ^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:26:6
|
||||
|
|
||||
26 | &x[0..=4];
|
||||
| ^^^^^^^^
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:25:6
|
||||
--> $DIR/indexing_slicing.rs:27:6
|
||||
|
|
||||
25 | &x[0..][..3];
|
||||
27 | &x[0..][..3];
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:26:6
|
||||
--> $DIR/indexing_slicing.rs:28:6
|
||||
|
|
||||
26 | &x[1..][..5];
|
||||
28 | &x[1..][..5];
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
||||
|
||||
error: indexing may panic.
|
||||
--> $DIR/indexing_slicing.rs:39:5
|
||||
--> $DIR/indexing_slicing.rs:41:5
|
||||
|
|
||||
39 | y[0];
|
||||
41 | y[0];
|
||||
| ^^^^
|
||||
|
|
||||
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:40:6
|
||||
--> $DIR/indexing_slicing.rs:42:6
|
||||
|
|
||||
40 | &y[1..2];
|
||||
42 | &y[1..2];
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:41:6
|
||||
--> $DIR/indexing_slicing.rs:43:6
|
||||
|
|
||||
41 | &y[0..=4];
|
||||
43 | &y[0..=4];
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:42:6
|
||||
--> $DIR/indexing_slicing.rs:44:6
|
||||
|
|
||||
42 | &y[..=4];
|
||||
44 | &y[..=4];
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:48:6
|
||||
|
|
||||
48 | &empty[1..5];
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:49:6
|
||||
|
|
||||
49 | &empty[0..=4];
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:50:6
|
||||
|
|
||||
50 | &empty[..=4];
|
||||
50 | &empty[1..5];
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:51:6
|
||||
|
|
||||
51 | &empty[1..];
|
||||
| ^^^^^^^^^^
|
||||
51 | &empty[0..=4];
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:52:6
|
||||
|
|
||||
52 | &empty[..4];
|
||||
| ^^^^^^^^^^
|
||||
52 | &empty[..=4];
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:53:6
|
||||
|
|
||||
53 | &empty[0..=0];
|
||||
| ^^^^^^^^^^^^
|
||||
53 | &empty[1..];
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:54:6
|
||||
|
|
||||
54 | &empty[..=0];
|
||||
54 | &empty[..4];
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:55:6
|
||||
|
|
||||
55 | &empty[0..=0];
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:56:6
|
||||
|
|
||||
56 | &empty[..=0];
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: indexing may panic.
|
||||
--> $DIR/indexing_slicing.rs:62:5
|
||||
--> $DIR/indexing_slicing.rs:64:5
|
||||
|
|
||||
62 | v[0];
|
||||
64 | v[0];
|
||||
| ^^^^
|
||||
|
|
||||
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
||||
|
||||
error: indexing may panic.
|
||||
--> $DIR/indexing_slicing.rs:63:5
|
||||
--> $DIR/indexing_slicing.rs:65:5
|
||||
|
|
||||
63 | v[10];
|
||||
65 | v[10];
|
||||
| ^^^^^
|
||||
|
|
||||
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
||||
|
||||
error: indexing may panic.
|
||||
--> $DIR/indexing_slicing.rs:64:5
|
||||
--> $DIR/indexing_slicing.rs:66:5
|
||||
|
|
||||
64 | v[1 << 3];
|
||||
66 | v[1 << 3];
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:65:6
|
||||
--> $DIR/indexing_slicing.rs:67:6
|
||||
|
|
||||
65 | &v[10..100];
|
||||
67 | &v[10..100];
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:66:6
|
||||
--> $DIR/indexing_slicing.rs:68:6
|
||||
|
|
||||
66 | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
|
||||
68 | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
||||
|
||||
error: range is out of bounds
|
||||
--> $DIR/indexing_slicing.rs:66:6
|
||||
--> $DIR/indexing_slicing.rs:68:6
|
||||
|
|
||||
66 | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
|
||||
68 | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
|
||||
| ^^^^^^^
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:67:6
|
||||
--> $DIR/indexing_slicing.rs:69:6
|
||||
|
|
||||
67 | &v[10..];
|
||||
69 | &v[10..];
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
|
||||
|
||||
error: slicing may panic.
|
||||
--> $DIR/indexing_slicing.rs:68:6
|
||||
--> $DIR/indexing_slicing.rs:70:6
|
||||
|
|
||||
68 | &v[..100];
|
||||
70 | &v[..100];
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
||||
|
||||
error: indexing may panic.
|
||||
--> $DIR/indexing_slicing.rs:80:5
|
||||
--> $DIR/indexing_slicing.rs:82:5
|
||||
|
|
||||
80 | v[N];
|
||||
82 | v[N];
|
||||
| ^^^^
|
||||
|
|
||||
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
||||
|
||||
error: indexing may panic.
|
||||
--> $DIR/indexing_slicing.rs:81:5
|
||||
--> $DIR/indexing_slicing.rs:83:5
|
||||
|
|
||||
81 | v[M];
|
||||
83 | v[M];
|
||||
| ^^^^
|
||||
|
|
||||
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
error: you seem to be trying to use match to destructure a single infallible pattern. Consider using `let`
|
||||
--> $DIR/infallible_destructuring_match.rs:16:5
|
||||
--> $DIR/infallible_destructuring_match.rs:18:5
|
||||
|
|
||||
16 | / let data = match wrapper {
|
||||
17 | | SingleVariantEnum::Variant(i) => i,
|
||||
18 | | };
|
||||
18 | / let data = match wrapper {
|
||||
19 | | SingleVariantEnum::Variant(i) => i,
|
||||
20 | | };
|
||||
| |______^ help: try this: `let SingleVariantEnum::Variant(data) = wrapper;`
|
||||
|
|
||||
= note: `-D infallible-destructuring-match` implied by `-D warnings`
|
||||
= note: `-D clippy::infallible-destructuring-match` implied by `-D warnings`
|
||||
|
||||
error: you seem to be trying to use match to destructure a single infallible pattern. Consider using `let`
|
||||
--> $DIR/infallible_destructuring_match.rs:37:5
|
||||
--> $DIR/infallible_destructuring_match.rs:39:5
|
||||
|
|
||||
37 | / let data = match wrapper {
|
||||
38 | | TupleStruct(i) => i,
|
||||
39 | | };
|
||||
39 | / let data = match wrapper {
|
||||
40 | | TupleStruct(i) => i,
|
||||
41 | | };
|
||||
| |______^ help: try this: `let TupleStruct(data) = wrapper;`
|
||||
|
||||
error: you seem to be trying to use match to destructure a single infallible pattern. Consider using `let`
|
||||
--> $DIR/infallible_destructuring_match.rs:58:5
|
||||
--> $DIR/infallible_destructuring_match.rs:60:5
|
||||
|
|
||||
58 | / let data = match wrapper {
|
||||
59 | | Ok(i) => i,
|
||||
60 | | };
|
||||
60 | / let data = match wrapper {
|
||||
61 | | Ok(i) => i,
|
||||
62 | | };
|
||||
| |______^ help: try this: `let Ok(data) = wrapper;`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
|
|
@ -4,7 +4,7 @@ error: you are collect()ing an iterator and throwing away the result. Consider u
|
|||
10 | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D unused-collect` implied by `-D warnings`
|
||||
= note: `-D clippy::unused-collect` implied by `-D warnings`
|
||||
|
||||
error: infinite iteration detected
|
||||
--> $DIR/infinite_iter.rs:10:5
|
||||
|
@ -15,8 +15,8 @@ error: infinite iteration detected
|
|||
note: lint level defined here
|
||||
--> $DIR/infinite_iter.rs:8:8
|
||||
|
|
||||
8 | #[deny(infinite_iter)]
|
||||
| ^^^^^^^^^^^^^
|
||||
8 | #[deny(clippy::infinite_iter)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: infinite iteration detected
|
||||
--> $DIR/infinite_iter.rs:11:5
|
||||
|
@ -57,8 +57,8 @@ error: possible infinite iteration detected
|
|||
note: lint level defined here
|
||||
--> $DIR/infinite_iter.rs:22:8
|
||||
|
|
||||
22 | #[deny(maybe_infinite_iter)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
22 | #[deny(clippy::maybe_infinite_iter)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: possible infinite iteration detected
|
||||
--> $DIR/infinite_iter.rs:25:5
|
||||
|
|
|
@ -1,57 +1,57 @@
|
|||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:14:11
|
||||
--> $DIR/infinite_loop.rs:16:11
|
||||
|
|
||||
14 | while y < 10 {
|
||||
16 | while y < 10 {
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: #[deny(while_immutable_condition)] on by default
|
||||
= note: #[deny(clippy::while_immutable_condition)] on by default
|
||||
|
||||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:19:11
|
||||
--> $DIR/infinite_loop.rs:21:11
|
||||
|
|
||||
19 | while y < 10 && x < 3 {
|
||||
21 | while y < 10 && x < 3 {
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:26:11
|
||||
--> $DIR/infinite_loop.rs:28:11
|
||||
|
|
||||
26 | while !cond {
|
||||
28 | while !cond {
|
||||
| ^^^^^
|
||||
|
||||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:70:11
|
||||
--> $DIR/infinite_loop.rs:72:11
|
||||
|
|
||||
70 | while i < 3 {
|
||||
72 | while i < 3 {
|
||||
| ^^^^^
|
||||
|
||||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:75:11
|
||||
--> $DIR/infinite_loop.rs:77:11
|
||||
|
|
||||
75 | while i < 3 && j > 0 {
|
||||
77 | while i < 3 && j > 0 {
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:79:11
|
||||
--> $DIR/infinite_loop.rs:81:11
|
||||
|
|
||||
79 | while i < 3 {
|
||||
81 | while i < 3 {
|
||||
| ^^^^^
|
||||
|
||||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:94:11
|
||||
--> $DIR/infinite_loop.rs:96:11
|
||||
|
|
||||
94 | while i < 3 {
|
||||
96 | while i < 3 {
|
||||
| ^^^^^
|
||||
|
||||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:99:11
|
||||
|
|
||||
99 | while i < 3 {
|
||||
| ^^^^^
|
||||
|
||||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:162:15
|
||||
--> $DIR/infinite_loop.rs:101:11
|
||||
|
|
||||
162 | while self.count < n {
|
||||
101 | while i < 3 {
|
||||
| ^^^^^
|
||||
|
||||
error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
|
||||
--> $DIR/infinite_loop.rs:164:15
|
||||
|
|
||||
164 | while self.count < n {
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
|
|
@ -6,7 +6,7 @@ error: use of `#[inline]` on trait method `default_inline` which has no body
|
|||
9 | | fn default_inline();
|
||||
| |____- help: remove
|
||||
|
|
||||
= note: `-D inline-fn-without-body` implied by `-D warnings`
|
||||
= note: `-D clippy::inline-fn-without-body` implied by `-D warnings`
|
||||
|
||||
error: use of `#[inline]` on trait method `always_inline` which has no body
|
||||
--> $DIR/inline_fn_without_body.rs:11:5
|
||||
|
|
|
@ -4,7 +4,7 @@ error: Unnecessary `>= y + 1` or `x - 1 >=`
|
|||
10 | x >= y + 1;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `-D int-plus-one` implied by `-D warnings`
|
||||
= note: `-D clippy::int-plus-one` implied by `-D warnings`
|
||||
help: change `>= y + 1` to `> y` as shown
|
||||
|
|
||||
10 | x > y;
|
||||
|
|
|
@ -4,7 +4,7 @@ error: reference to zeroed memory
|
|||
27 | let ref_zero: &T = std::mem::zeroed(); // warning
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: #[deny(invalid_ref)] on by default
|
||||
= note: #[deny(clippy::invalid_ref)] on by default
|
||||
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
|
||||
|
||||
error: reference to zeroed memory
|
||||
|
|
|
@ -4,7 +4,7 @@ error: because of the numeric bounds on `u8` prior to casting, this expression i
|
|||
16 | (u8 as u32) > 300;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D invalid-upcast-comparisons` implied by `-D warnings`
|
||||
= note: `-D clippy::invalid-upcast-comparisons` implied by `-D warnings`
|
||||
|
||||
error: because of the numeric bounds on `u8` prior to casting, this expression is always false
|
||||
--> $DIR/invalid_upcast_comparisons.rs:17:5
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
error: this loop could be written as a `for` loop
|
||||
--> $DIR/issue_2356.rs:15:29
|
||||
--> $DIR/issue_2356.rs:17:29
|
||||
|
|
||||
15 | while let Some(e) = it.next() {
|
||||
17 | while let Some(e) = it.next() {
|
||||
| ^^^^^^^^^ help: try: `for e in it { .. }`
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/issue_2356.rs:1:9
|
||||
--> $DIR/issue_2356.rs:3:9
|
||||
|
|
||||
1 | #![deny(while_let_on_iterator)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
3 | #![deny(clippy::while_let_on_iterator)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ error: adding items after statements is confusing, since items exist from the st
|
|||
12 | fn foo() { println!("foo"); }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D items-after-statements` implied by `-D warnings`
|
||||
= note: `-D clippy::items-after-statements` implied by `-D warnings`
|
||||
|
||||
error: adding items after statements is confusing, since items exist from the start of the scope
|
||||
--> $DIR/item_after_statement.rs:17:5
|
||||
|
|
|
@ -4,7 +4,7 @@ error: digit groups should be smaller
|
|||
7 | let bad = (0b1_10110_i64, 0x1_23456_78901_usize, 1_23456_f32, 1_23456.12_f32, 1_23456.12345_f32, 1_23456.12345_6_f32);
|
||||
| ^^^^^^^^^^^^^ help: consider: `0b11_0110_i64`
|
||||
|
|
||||
= note: `-D large-digit-groups` implied by `-D warnings`
|
||||
= note: `-D clippy::large-digit-groups` implied by `-D warnings`
|
||||
|
||||
error: digit groups should be smaller
|
||||
--> $DIR/large_digit_groups.rs:7:31
|
||||
|
|
|
@ -4,7 +4,7 @@ error: large size difference between variants
|
|||
10 | B([i32; 8000]),
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D large-enum-variant` implied by `-D warnings`
|
||||
= note: `-D clippy::large-enum-variant` implied by `-D warnings`
|
||||
help: consider boxing the large fields to reduce the total size of the enum
|
||||
|
|
||||
10 | B(Box<[i32; 8000]>),
|
||||
|
|
|
@ -1,139 +1,139 @@
|
|||
error: item `PubOne` has a public `len` method but no corresponding `is_empty` method
|
||||
--> $DIR/len_zero.rs:6:1
|
||||
--> $DIR/len_zero.rs:8:1
|
||||
|
|
||||
6 | / impl PubOne {
|
||||
7 | | pub fn len(self: &Self) -> isize {
|
||||
8 | | 1
|
||||
9 | | }
|
||||
10 | | }
|
||||
8 | / impl PubOne {
|
||||
9 | | pub fn len(self: &Self) -> isize {
|
||||
10 | | 1
|
||||
11 | | }
|
||||
12 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D len-without-is-empty` implied by `-D warnings`
|
||||
= note: `-D clippy::len-without-is-empty` implied by `-D warnings`
|
||||
|
||||
error: trait `PubTraitsToo` has a `len` method but no (possibly inherited) `is_empty` method
|
||||
--> $DIR/len_zero.rs:55:1
|
||||
--> $DIR/len_zero.rs:57:1
|
||||
|
|
||||
55 | / pub trait PubTraitsToo {
|
||||
56 | | fn len(self: &Self) -> isize;
|
||||
57 | | }
|
||||
57 | / pub trait PubTraitsToo {
|
||||
58 | | fn len(self: &Self) -> isize;
|
||||
59 | | }
|
||||
| |_^
|
||||
|
||||
error: item `HasIsEmpty` has a public `len` method but a private `is_empty` method
|
||||
--> $DIR/len_zero.rs:89:1
|
||||
--> $DIR/len_zero.rs:91:1
|
||||
|
|
||||
89 | / impl HasIsEmpty {
|
||||
90 | | pub fn len(self: &Self) -> isize {
|
||||
91 | | 1
|
||||
92 | | }
|
||||
91 | / impl HasIsEmpty {
|
||||
92 | | pub fn len(self: &Self) -> isize {
|
||||
93 | | 1
|
||||
94 | | }
|
||||
... |
|
||||
96 | | }
|
||||
97 | | }
|
||||
98 | | }
|
||||
99 | | }
|
||||
| |_^
|
||||
|
||||
error: item `HasWrongIsEmpty` has a public `len` method but no corresponding `is_empty` method
|
||||
--> $DIR/len_zero.rs:118:1
|
||||
--> $DIR/len_zero.rs:120:1
|
||||
|
|
||||
118 | / impl HasWrongIsEmpty {
|
||||
119 | | pub fn len(self: &Self) -> isize {
|
||||
120 | | 1
|
||||
121 | | }
|
||||
120 | / impl HasWrongIsEmpty {
|
||||
121 | | pub fn len(self: &Self) -> isize {
|
||||
122 | | 1
|
||||
123 | | }
|
||||
... |
|
||||
125 | | }
|
||||
126 | | }
|
||||
127 | | }
|
||||
128 | | }
|
||||
| |_^
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:139:8
|
||||
--> $DIR/len_zero.rs:141:8
|
||||
|
|
||||
139 | if x.len() == 0 {
|
||||
141 | if x.len() == 0 {
|
||||
| ^^^^^^^^^^^^ help: using `is_empty` is more concise: `x.is_empty()`
|
||||
|
|
||||
= note: `-D len-zero` implied by `-D warnings`
|
||||
= note: `-D clippy::len-zero` implied by `-D warnings`
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:143:8
|
||||
--> $DIR/len_zero.rs:145:8
|
||||
|
|
||||
143 | if "".len() == 0 {}
|
||||
145 | if "".len() == 0 {}
|
||||
| ^^^^^^^^^^^^^ help: using `is_empty` is more concise: `"".is_empty()`
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:158:8
|
||||
--> $DIR/len_zero.rs:160:8
|
||||
|
|
||||
158 | if has_is_empty.len() == 0 {
|
||||
160 | if has_is_empty.len() == 0 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:161:8
|
||||
--> $DIR/len_zero.rs:163:8
|
||||
|
|
||||
161 | if has_is_empty.len() != 0 {
|
||||
163 | if has_is_empty.len() != 0 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:164:8
|
||||
--> $DIR/len_zero.rs:166:8
|
||||
|
|
||||
164 | if has_is_empty.len() > 0 {
|
||||
166 | if has_is_empty.len() > 0 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to one
|
||||
--> $DIR/len_zero.rs:167:8
|
||||
--> $DIR/len_zero.rs:169:8
|
||||
|
|
||||
167 | if has_is_empty.len() < 1 {
|
||||
169 | if has_is_empty.len() < 1 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to one
|
||||
--> $DIR/len_zero.rs:170:8
|
||||
--> $DIR/len_zero.rs:172:8
|
||||
|
|
||||
170 | if has_is_empty.len() >= 1 {
|
||||
172 | if has_is_empty.len() >= 1 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:181:8
|
||||
--> $DIR/len_zero.rs:183:8
|
||||
|
|
||||
181 | if 0 == has_is_empty.len() {
|
||||
183 | if 0 == has_is_empty.len() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:184:8
|
||||
--> $DIR/len_zero.rs:186:8
|
||||
|
|
||||
184 | if 0 != has_is_empty.len() {
|
||||
186 | if 0 != has_is_empty.len() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:187:8
|
||||
--> $DIR/len_zero.rs:189:8
|
||||
|
|
||||
187 | if 0 < has_is_empty.len() {
|
||||
189 | if 0 < has_is_empty.len() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to one
|
||||
--> $DIR/len_zero.rs:190:8
|
||||
--> $DIR/len_zero.rs:192:8
|
||||
|
|
||||
190 | if 1 <= has_is_empty.len() {
|
||||
192 | if 1 <= has_is_empty.len() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to one
|
||||
--> $DIR/len_zero.rs:193:8
|
||||
--> $DIR/len_zero.rs:195:8
|
||||
|
|
||||
193 | if 1 > has_is_empty.len() {
|
||||
195 | if 1 > has_is_empty.len() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `has_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:207:8
|
||||
--> $DIR/len_zero.rs:209:8
|
||||
|
|
||||
207 | if with_is_empty.len() == 0 {
|
||||
209 | if with_is_empty.len() == 0 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `with_is_empty.is_empty()`
|
||||
|
||||
error: length comparison to zero
|
||||
--> $DIR/len_zero.rs:220:8
|
||||
--> $DIR/len_zero.rs:222:8
|
||||
|
|
||||
220 | if b.len() != 0 {}
|
||||
222 | if b.len() != 0 {}
|
||||
| ^^^^^^^^^^^^ help: using `is_empty` is more concise: `!b.is_empty()`
|
||||
|
||||
error: trait `DependsOnFoo` has a `len` method but no (possibly inherited) `is_empty` method
|
||||
--> $DIR/len_zero.rs:226:1
|
||||
--> $DIR/len_zero.rs:228:1
|
||||
|
|
||||
226 | / pub trait DependsOnFoo: Foo {
|
||||
227 | | fn len(&mut self) -> usize;
|
||||
228 | | }
|
||||
228 | / pub trait DependsOnFoo: Foo {
|
||||
229 | | fn len(&mut self) -> usize;
|
||||
230 | | }
|
||||
| |_^
|
||||
|
||||
error: aborting due to 19 previous errors
|
||||
|
|
|
@ -7,7 +7,7 @@ error: `if _ { .. } else { .. }` is an expression
|
|||
60 | | }
|
||||
| |_____^ help: it is more idiomatic to write: `let <mut> foo = if f() { 42 } else { 0 };`
|
||||
|
|
||||
= note: `-D useless-let-if-seq` implied by `-D warnings`
|
||||
= note: `-D clippy::useless-let-if-seq` implied by `-D warnings`
|
||||
= note: you might not need `mut` at all
|
||||
|
||||
error: `if _ { .. } else { .. }` is an expression
|
||||
|
|
|
@ -4,7 +4,7 @@ error: returning the result of a let binding from a block. Consider returning th
|
|||
10 | x
|
||||
| ^
|
||||
|
|
||||
= note: `-D let-and-return` implied by `-D warnings`
|
||||
= note: `-D clippy::let-and-return` implied by `-D warnings`
|
||||
note: this expression can be directly returned
|
||||
--> $DIR/let_return.rs:9:13
|
||||
|
|
||||
|
|
|
@ -4,7 +4,7 @@ error: this let-binding has unit value. Consider omitting `let _x =`
|
|||
14 | let _x = println!("x");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D let-unit-value` implied by `-D warnings`
|
||||
= note: `-D clippy::let-unit-value` implied by `-D warnings`
|
||||
|
||||
error: this let-binding has unit value. Consider omitting `let _a =`
|
||||
--> $DIR/let_unit.rs:18:9
|
||||
|
|
|
@ -4,7 +4,7 @@ error: explicit lifetimes given in parameter types where they could be elided
|
|||
7 | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D needless-lifetimes` implied by `-D warnings`
|
||||
= note: `-D clippy::needless-lifetimes` implied by `-D warnings`
|
||||
|
||||
error: explicit lifetimes given in parameter types where they could be elided
|
||||
--> $DIR/lifetimes.rs:9:1
|
||||
|
|
|
@ -1,124 +1,124 @@
|
|||
error: inconsistent casing in hexadecimal literal
|
||||
--> $DIR/literals.rs:12:17
|
||||
|
|
||||
12 | let fail1 = 0xabCD;
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `-D mixed-case-hex-literals` implied by `-D warnings`
|
||||
|
||||
error: inconsistent casing in hexadecimal literal
|
||||
--> $DIR/literals.rs:13:17
|
||||
|
|
||||
13 | let fail2 = 0xabCD_u32;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: inconsistent casing in hexadecimal literal
|
||||
--> $DIR/literals.rs:14:17
|
||||
|
|
||||
14 | let fail2 = 0xabCD_isize;
|
||||
14 | let fail1 = 0xabCD;
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `-D clippy::mixed-case-hex-literals` implied by `-D warnings`
|
||||
|
||||
error: inconsistent casing in hexadecimal literal
|
||||
--> $DIR/literals.rs:15:17
|
||||
|
|
||||
15 | let fail2 = 0xabCD_u32;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: inconsistent casing in hexadecimal literal
|
||||
--> $DIR/literals.rs:16:17
|
||||
|
|
||||
16 | let fail2 = 0xabCD_isize;
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: integer type suffix should be separated by an underscore
|
||||
--> $DIR/literals.rs:15:27
|
||||
--> $DIR/literals.rs:17:27
|
||||
|
|
||||
15 | let fail_multi_zero = 000_123usize;
|
||||
17 | let fail_multi_zero = 000_123usize;
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D unseparated-literal-suffix` implied by `-D warnings`
|
||||
= note: `-D clippy::unseparated-literal-suffix` implied by `-D warnings`
|
||||
|
||||
error: this is a decimal constant
|
||||
--> $DIR/literals.rs:15:27
|
||||
--> $DIR/literals.rs:17:27
|
||||
|
|
||||
15 | let fail_multi_zero = 000_123usize;
|
||||
17 | let fail_multi_zero = 000_123usize;
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D zero-prefixed-literal` implied by `-D warnings`
|
||||
= note: `-D clippy::zero-prefixed-literal` implied by `-D warnings`
|
||||
help: if you mean to use a decimal constant, remove the `0` to remove confusion
|
||||
|
|
||||
15 | let fail_multi_zero = 123usize;
|
||||
17 | let fail_multi_zero = 123usize;
|
||||
| ^^^^^^^^
|
||||
help: if you mean to use an octal constant, use `0o`
|
||||
|
|
||||
15 | let fail_multi_zero = 0o123usize;
|
||||
17 | let fail_multi_zero = 0o123usize;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: integer type suffix should be separated by an underscore
|
||||
--> $DIR/literals.rs:20:17
|
||||
|
|
||||
20 | let fail3 = 1234i32;
|
||||
| ^^^^^^^
|
||||
|
||||
error: integer type suffix should be separated by an underscore
|
||||
--> $DIR/literals.rs:21:17
|
||||
|
|
||||
21 | let fail4 = 1234u32;
|
||||
| ^^^^^^^
|
||||
|
||||
error: integer type suffix should be separated by an underscore
|
||||
--> $DIR/literals.rs:22:17
|
||||
|
|
||||
22 | let fail5 = 1234isize;
|
||||
| ^^^^^^^^^
|
||||
22 | let fail3 = 1234i32;
|
||||
| ^^^^^^^
|
||||
|
||||
error: integer type suffix should be separated by an underscore
|
||||
--> $DIR/literals.rs:23:17
|
||||
|
|
||||
23 | let fail6 = 1234usize;
|
||||
23 | let fail4 = 1234u32;
|
||||
| ^^^^^^^
|
||||
|
||||
error: integer type suffix should be separated by an underscore
|
||||
--> $DIR/literals.rs:24:17
|
||||
|
|
||||
24 | let fail5 = 1234isize;
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: integer type suffix should be separated by an underscore
|
||||
--> $DIR/literals.rs:25:17
|
||||
|
|
||||
25 | let fail6 = 1234usize;
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: float type suffix should be separated by an underscore
|
||||
--> $DIR/literals.rs:24:17
|
||||
--> $DIR/literals.rs:26:17
|
||||
|
|
||||
24 | let fail7 = 1.5f32;
|
||||
26 | let fail7 = 1.5f32;
|
||||
| ^^^^^^
|
||||
|
||||
error: this is a decimal constant
|
||||
--> $DIR/literals.rs:28:17
|
||||
--> $DIR/literals.rs:30:17
|
||||
|
|
||||
28 | let fail8 = 0123;
|
||||
30 | let fail8 = 0123;
|
||||
| ^^^^
|
||||
help: if you mean to use a decimal constant, remove the `0` to remove confusion
|
||||
|
|
||||
28 | let fail8 = 123;
|
||||
30 | let fail8 = 123;
|
||||
| ^^^
|
||||
help: if you mean to use an octal constant, use `0o`
|
||||
|
|
||||
28 | let fail8 = 0o123;
|
||||
30 | let fail8 = 0o123;
|
||||
| ^^^^^
|
||||
|
||||
error: long literal lacking separators
|
||||
--> $DIR/literals.rs:39:17
|
||||
--> $DIR/literals.rs:41:17
|
||||
|
|
||||
39 | let fail9 = 0xabcdef;
|
||||
41 | let fail9 = 0xabcdef;
|
||||
| ^^^^^^^^ help: consider: `0x00ab_cdef`
|
||||
|
|
||||
= note: `-D unreadable-literal` implied by `-D warnings`
|
||||
|
||||
error: long literal lacking separators
|
||||
--> $DIR/literals.rs:40:18
|
||||
|
|
||||
40 | let fail10 = 0xBAFEBAFE;
|
||||
| ^^^^^^^^^^ help: consider: `0xBAFE_BAFE`
|
||||
|
||||
error: long literal lacking separators
|
||||
--> $DIR/literals.rs:41:18
|
||||
|
|
||||
41 | let fail11 = 0xabcdeff;
|
||||
| ^^^^^^^^^ help: consider: `0x0abc_deff`
|
||||
= note: `-D clippy::unreadable-literal` implied by `-D warnings`
|
||||
|
||||
error: long literal lacking separators
|
||||
--> $DIR/literals.rs:42:18
|
||||
|
|
||||
42 | let fail12 = 0xabcabcabcabcabcabc;
|
||||
42 | let fail10 = 0xBAFEBAFE;
|
||||
| ^^^^^^^^^^ help: consider: `0xBAFE_BAFE`
|
||||
|
||||
error: long literal lacking separators
|
||||
--> $DIR/literals.rs:43:18
|
||||
|
|
||||
43 | let fail11 = 0xabcdeff;
|
||||
| ^^^^^^^^^ help: consider: `0x0abc_deff`
|
||||
|
||||
error: long literal lacking separators
|
||||
--> $DIR/literals.rs:44:18
|
||||
|
|
||||
44 | let fail12 = 0xabcabcabcabcabcabc;
|
||||
| ^^^^^^^^^^^^^^^^^^^^ help: consider: `0x00ab_cabc_abca_bcab_cabc`
|
||||
|
||||
error: digit groups should be smaller
|
||||
--> $DIR/literals.rs:43:18
|
||||
--> $DIR/literals.rs:45:18
|
||||
|
|
||||
43 | let fail13 = 0x1_23456_78901_usize;
|
||||
45 | let fail13 = 0x1_23456_78901_usize;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ help: consider: `0x0123_4567_8901_usize`
|
||||
|
|
||||
= note: `-D large-digit-groups` implied by `-D warnings`
|
||||
= note: `-D clippy::large-digit-groups` implied by `-D warnings`
|
||||
|
||||
error: aborting due to 16 previous errors
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ error: you seem to be using .map() to clone the contents of an iterator, conside
|
|||
12 | x.iter().map(|y| y.clone());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D map-clone` implied by `-D warnings`
|
||||
= note: `-D clippy::map-clone` implied by `-D warnings`
|
||||
= help: try
|
||||
x.iter().cloned()
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ error: this boolean expression can be simplified
|
|||
25 | match test && test {
|
||||
| ^^^^^^^^^^^^ help: try: `test`
|
||||
|
|
||||
= note: `-D nonminimal-bool` implied by `-D warnings`
|
||||
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
|
||||
|
||||
error: you seem to be trying to match on a boolean expression
|
||||
--> $DIR/match_bool.rs:4:5
|
||||
|
@ -15,7 +15,7 @@ error: you seem to be trying to match on a boolean expression
|
|||
7 | | };
|
||||
| |_____^ help: consider using an if/else expression: `if test { 0 } else { 42 }`
|
||||
|
|
||||
= note: `-D match-bool` implied by `-D warnings`
|
||||
= note: `-D clippy::match-bool` implied by `-D warnings`
|
||||
|
||||
error: you seem to be trying to match on a boolean expression
|
||||
--> $DIR/match_bool.rs:10:5
|
||||
|
@ -59,7 +59,7 @@ error: equal expressions as operands to `&&`
|
|||
25 | match test && test {
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: #[deny(eq_op)] on by default
|
||||
= note: #[deny(clippy::eq_op)] on by default
|
||||
|
||||
error: you seem to be trying to match on a boolean expression
|
||||
--> $DIR/match_bool.rs:30:5
|
||||
|
|
|
@ -7,7 +7,7 @@ error: you seem to be trying to use match for destructuring a single pattern. Co
|
|||
24 | | }
|
||||
| |_____^ help: try this: `if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }`
|
||||
|
|
||||
= note: `-D single-match-else` implied by `-D warnings`
|
||||
= note: `-D clippy::single-match-else` implied by `-D warnings`
|
||||
|
||||
error: you don't need to add `&` to all patterns
|
||||
--> $DIR/matches.rs:30:9
|
||||
|
@ -18,7 +18,7 @@ error: you don't need to add `&` to all patterns
|
|||
33 | | }
|
||||
| |_________^
|
||||
|
|
||||
= note: `-D match-ref-pats` implied by `-D warnings`
|
||||
= note: `-D clippy::match-ref-pats` implied by `-D warnings`
|
||||
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
||||
|
|
||||
30 | match *v {
|
||||
|
@ -94,7 +94,7 @@ error: some ranges overlap
|
|||
71 | 0 ... 10 => println!("0 ... 10"),
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: `-D match-overlapping-arm` implied by `-D warnings`
|
||||
= note: `-D clippy::match-overlapping-arm` implied by `-D warnings`
|
||||
note: overlaps with this
|
||||
--> $DIR/matches.rs:72:9
|
||||
|
|
||||
|
@ -155,7 +155,7 @@ error: Err(_) will match all errors, maybe not a good idea
|
|||
132 | Err(_) => panic!("err")
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `-D match-wild-err-arm` implied by `-D warnings`
|
||||
= note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
|
||||
= note: to remove this warning, match each error separately or use unreachable macro
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
|
@ -164,7 +164,7 @@ error: this `match` has identical arm bodies
|
|||
131 | Ok(_) => println!("ok"),
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D match-same-arms` implied by `-D warnings`
|
||||
= note: `-D clippy::match-same-arms` implied by `-D warnings`
|
||||
note: same as this
|
||||
--> $DIR/matches.rs:130:18
|
||||
|
|
||||
|
@ -347,7 +347,7 @@ error: use as_ref() instead
|
|||
215 | | };
|
||||
| |_____^ help: try this: `owned.as_ref()`
|
||||
|
|
||||
= note: `-D match-as-ref` implied by `-D warnings`
|
||||
= note: `-D clippy::match-as-ref` implied by `-D warnings`
|
||||
|
||||
error: use as_mut() instead
|
||||
--> $DIR/matches.rs:218:39
|
||||
|
|
|
@ -4,7 +4,7 @@ error: usage of mem::forget on Drop type
|
|||
18 | memstuff::forget(six);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D mem-forget` implied by `-D warnings`
|
||||
= note: `-D clippy::mem-forget` implied by `-D warnings`
|
||||
|
||||
error: usage of mem::forget on Drop type
|
||||
--> $DIR/mem_forget.rs:21:5
|
||||
|
|
|
@ -4,7 +4,7 @@ error: defining a method called `add` on this type; consider implementing the `s
|
|||
21 | pub fn add(self, other: T) -> T { self }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D should-implement-trait` implied by `-D warnings`
|
||||
= note: `-D clippy::should-implement-trait` implied by `-D warnings`
|
||||
|
||||
error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
|
||||
--> $DIR/methods.rs:32:17
|
||||
|
@ -12,7 +12,7 @@ error: methods called `into_*` usually take self by value; consider choosing a l
|
|||
32 | fn into_u16(&self) -> u16 { 0 }
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `-D wrong-self-convention` implied by `-D warnings`
|
||||
= note: `-D clippy::wrong-self-convention` implied by `-D warnings`
|
||||
|
||||
error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
|
||||
--> $DIR/methods.rs:34:21
|
||||
|
@ -32,7 +32,7 @@ error: methods called `new` usually return `Self`
|
|||
36 | fn new(self) {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D new-ret-no-self` implied by `-D warnings`
|
||||
= note: `-D clippy::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
|
||||
--> $DIR/methods.rs:104:13
|
||||
|
@ -43,7 +43,7 @@ error: called `map(f).unwrap_or(a)` on an Option value. This can be done more di
|
|||
106 | | .unwrap_or(0); // should lint even though this call is on a separate line
|
||||
| |____________________________^
|
||||
|
|
||||
= note: `-D option-map-unwrap-or` implied by `-D warnings`
|
||||
= note: `-D clippy::option-map-unwrap-or` implied by `-D warnings`
|
||||
= 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
|
||||
|
@ -104,7 +104,7 @@ error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done mo
|
|||
133 | | .unwrap_or_else(|| 0); // should lint even though this call is on a separate line
|
||||
| |____________________________________^
|
||||
|
|
||||
= note: `-D option-map-unwrap-or-else` implied by `-D warnings`
|
||||
= note: `-D clippy::option-map-unwrap-or-else` implied by `-D warnings`
|
||||
= 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
|
||||
|
@ -133,7 +133,7 @@ error: called `map_or(None, f)` on an Option value. This can be done more direct
|
|||
148 | let _ = opt.map_or(None, |x| Some(x + 1));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using and_then instead: `opt.and_then(|x| Some(x + 1))`
|
||||
|
|
||||
= note: `-D option-map-or-none` implied by `-D warnings`
|
||||
= note: `-D clippy::option-map-or-none` implied by `-D warnings`
|
||||
|
||||
error: called `map_or(None, f)` on an Option value. This can be done more directly by calling `and_then(f)` instead
|
||||
--> $DIR/methods.rs:150:13
|
||||
|
@ -160,7 +160,7 @@ error: called `map(f).unwrap_or_else(g)` on a Result value. This can be done mor
|
|||
165 | | .unwrap_or_else(|e| 0); // should lint even though this call is on a separate line
|
||||
| |_____________________________________^
|
||||
|
|
||||
= note: `-D result-map-unwrap-or-else` implied by `-D warnings`
|
||||
= note: `-D clippy::result-map-unwrap-or-else` implied by `-D warnings`
|
||||
= note: replace `map(|x| x + 1).unwrap_or_else(|e| 0)` with `ok().map_or_else(|e| 0, |x| x + 1)`
|
||||
|
||||
error: called `map(f).unwrap_or_else(g)` on a Result value. This can be done more directly by calling `ok().map_or_else(g, f)` instead
|
||||
|
@ -189,7 +189,7 @@ error: called `filter(p).next()` on an `Iterator`. This is more succinctly expre
|
|||
234 | let _ = v.iter().filter(|&x| *x < 0).next();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D filter-next` implied by `-D warnings`
|
||||
= note: `-D clippy::filter-next` implied by `-D warnings`
|
||||
= 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.
|
||||
|
@ -208,7 +208,7 @@ error: called `is_some()` after searching an `Iterator` with find. This is more
|
|||
252 | let _ = v.iter().find(|&x| *x < 0).is_some();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D search-is-some` implied by `-D warnings`
|
||||
= note: `-D clippy::search-is-some` implied by `-D warnings`
|
||||
= 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()`.
|
||||
|
@ -263,7 +263,7 @@ error: use of `unwrap_or` followed by a function call
|
|||
308 | with_constructor.unwrap_or(make());
|
||||
| ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(make)`
|
||||
|
|
||||
= note: `-D or-fun-call` implied by `-D warnings`
|
||||
= note: `-D clippy::or-fun-call` implied by `-D warnings`
|
||||
|
||||
error: use of `unwrap_or` followed by a call to `new`
|
||||
--> $DIR/methods.rs:311:5
|
||||
|
@ -337,7 +337,7 @@ error: `error_code` is shadowed by `123_i32`
|
|||
377 | let error_code = 123_i32;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `-D shadow-unrelated` implied by `-D warnings`
|
||||
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
|
||||
note: initialization happens here
|
||||
--> $DIR/methods.rs:377:22
|
||||
|
|
||||
|
@ -355,7 +355,7 @@ error: use of `expect` followed by a function call
|
|||
366 | with_none_and_format.expect(&format!("Error {}: fake error", error_code));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
|
||||
|
|
||||
= note: `-D expect-fun-call` implied by `-D warnings`
|
||||
= note: `-D clippy::expect-fun-call` implied by `-D warnings`
|
||||
|
||||
error: use of `expect` followed by a function call
|
||||
--> $DIR/methods.rs:369:26
|
||||
|
@ -381,7 +381,7 @@ error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more
|
|||
406 | let bad_vec = some_vec.iter().nth(3);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D iter-nth` implied by `-D warnings`
|
||||
= note: `-D clippy::iter-nth` implied by `-D warnings`
|
||||
|
||||
error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
|
||||
--> $DIR/methods.rs:407:26
|
||||
|
@ -425,7 +425,7 @@ error: called `skip(x).next()` on an iterator. This is more succinctly expressed
|
|||
432 | let _ = some_vec.iter().skip(42).next();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D iter-skip-next` implied by `-D warnings`
|
||||
= note: `-D clippy::iter-skip-next` implied by `-D warnings`
|
||||
|
||||
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
|
||||
--> $DIR/methods.rs:433:13
|
||||
|
@ -451,7 +451,7 @@ error: used unwrap() on an Option value. If you don't want to handle the None ca
|
|||
444 | let _ = opt.unwrap();
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D option-unwrap-used` implied by `-D warnings`
|
||||
= note: `-D clippy::option-unwrap-used` implied by `-D warnings`
|
||||
|
||||
error: aborting due to 56 previous errors
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue