bless clippy

This commit is contained in:
Maybe Waffle 2022-09-22 20:04:22 +04:00
parent 13b67fb9d2
commit 9d388dc390
205 changed files with 231 additions and 231 deletions

View File

@ -4,8 +4,8 @@ error: `std::string::String` may not be held across an `await` point per `clippy
LL | let _x = String::from("hello"); LL | let _x = String::from("hello");
| ^^ | ^^
| |
= note: `-D clippy::await-holding-invalid-type` implied by `-D warnings`
= note: strings are bad = note: strings are bad
= note: `-D clippy::await-holding-invalid-type` implied by `-D warnings`
error: `std::net::Ipv4Addr` may not be held across an `await` point per `clippy.toml` error: `std::net::Ipv4Addr` may not be held across an `await` point per `clippy.toml`
--> $DIR/await_holding_invalid_type.rs:10:9 --> $DIR/await_holding_invalid_type.rs:10:9

View File

@ -8,8 +8,8 @@ error: the function has a cognitive complexity of (3/2)
LL | fn cognitive_complexity() { LL | fn cognitive_complexity() {
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: you could split it up into multiple smaller functions = help: you could split it up into multiple smaller functions
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
error: aborting due to previous error; 2 warnings emitted error: aborting due to previous error; 2 warnings emitted

View File

@ -4,8 +4,8 @@ error: used `expect()` on `an Option` value
LL | let _ = opt.expect(""); LL | let _ = opt.expect("");
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= note: `-D clippy::expect-used` implied by `-D warnings`
= help: if this value is `None`, it will panic = help: if this value is `None`, it will panic
= note: `-D clippy::expect-used` implied by `-D warnings`
error: used `expect()` on `a Result` value error: used `expect()` on `a Result` value
--> $DIR/expect_used.rs:11:13 --> $DIR/expect_used.rs:11:13

View File

@ -4,8 +4,8 @@ error: more than 1 bools in function parameters
LL | fn g(_: bool, _: bool) {} LL | fn g(_: bool, _: bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
= help: consider refactoring bools into two-variant enums = help: consider refactoring bools into two-variant enums
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: attempted to include a large file
LL | const TOO_BIG_INCLUDE_BYTES: &[u8; 654] = include_bytes!("too_big.txt"); LL | const TOO_BIG_INCLUDE_BYTES: &[u8; 654] = include_bytes!("too_big.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::large-include-file` implied by `-D warnings`
= note: the configuration allows a maximum size of 600 bytes = note: the configuration allows a maximum size of 600 bytes
= note: `-D clippy::large-include-file` implied by `-D warnings`
= note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
error: attempted to include a large file error: attempted to include a large file

View File

@ -4,12 +4,12 @@ error: use of irregular braces for `vec!` macro
LL | let _ = vec! {1, 2, 3}; LL | let _ = vec! {1, 2, 3};
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= note: `-D clippy::nonstandard-macro-braces` implied by `-D warnings`
help: consider writing `vec![1, 2, 3]` help: consider writing `vec![1, 2, 3]`
--> $DIR/conf_nonstandard_macro_braces.rs:43:13 --> $DIR/conf_nonstandard_macro_braces.rs:43:13
| |
LL | let _ = vec! {1, 2, 3}; LL | let _ = vec! {1, 2, 3};
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
= note: `-D clippy::nonstandard-macro-braces` implied by `-D warnings`
error: use of irregular braces for `format!` macro error: use of irregular braces for `format!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:44:13 --> $DIR/conf_nonstandard_macro_braces.rs:44:13

View File

@ -4,13 +4,13 @@ error: some fields in `NoGeneric` are not safe to be sent to another thread
LL | unsafe impl Send for NoGeneric {} LL | unsafe impl Send for NoGeneric {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::non-send-fields-in-send-ty` implied by `-D warnings`
note: it is not safe to send field `rc_is_not_send` to another thread note: it is not safe to send field `rc_is_not_send` to another thread
--> $DIR/test.rs:8:5 --> $DIR/test.rs:8:5
| |
LL | rc_is_not_send: Rc<String>, LL | rc_is_not_send: Rc<String>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: use a thread-safe type that implements `Send` = help: use a thread-safe type that implements `Send`
= note: `-D clippy::non-send-fields-in-send-ty` implied by `-D warnings`
error: some fields in `MultiField<T>` are not safe to be sent to another thread error: some fields in `MultiField<T>` are not safe to be sent to another thread
--> $DIR/test.rs:19:1 --> $DIR/test.rs:19:1

View File

@ -6,8 +6,8 @@ LL | | a: bool,
LL | | } LL | | }
| |_^ | |_^
| |
= note: `-D clippy::struct-excessive-bools` implied by `-D warnings`
= help: consider using a state machine or refactoring bools into two-variant enums = help: consider using a state machine or refactoring bools into two-variant enums
= note: `-D clippy::struct-excessive-bools` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -16,8 +16,8 @@ error: used `unwrap()` on `an Option` value
LL | let _ = boxed_slice.get(1).unwrap(); LL | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::unwrap-used` implied by `-D warnings`
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
= note: `-D clippy::unwrap-used` implied by `-D warnings`
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:36:17 --> $DIR/unwrap_used.rs:36:17

View File

@ -4,8 +4,8 @@ error: this comparison involving the minimum or maximum element for this type co
LL | u <= 0; LL | u <= 0;
| ^^^^^^ | ^^^^^^
| |
= 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 = 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
= note: `-D clippy::absurd-extreme-comparisons` implied by `-D warnings`
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:15:5 --> $DIR/absurd-extreme-comparisons.rs:15:5

View File

@ -4,12 +4,12 @@ error: `allow` attribute without specifying a reason
LL | #[allow(dead_code)] LL | #[allow(dead_code)]
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
| |
= help: try adding a reason at the end with `, reason = ".."`
note: the lint level is defined here note: the lint level is defined here
--> $DIR/allow_attributes_without_reason.rs:2:9 --> $DIR/allow_attributes_without_reason.rs:2:9
| |
LL | #![deny(clippy::allow_attributes_without_reason)] LL | #![deny(clippy::allow_attributes_without_reason)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: try adding a reason at the end with `, reason = ".."`
error: `allow` attribute without specifying a reason error: `allow` attribute without specifying a reason
--> $DIR/allow_attributes_without_reason.rs:6:1 --> $DIR/allow_attributes_without_reason.rs:6:1

View File

@ -4,8 +4,8 @@ error: approximate value of `f{32, 64}::consts::E` found
LL | let my_e = 2.7182; LL | let my_e = 2.7182;
| ^^^^^^ | ^^^^^^
| |
= note: `-D clippy::approx-constant` implied by `-D warnings`
= help: consider using the constant directly = help: consider using the constant directly
= note: `-D clippy::approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::E` found error: approximate value of `f{32, 64}::consts::E` found
--> $DIR/approx_const.rs:5:20 --> $DIR/approx_const.rs:5:20

View File

@ -4,8 +4,8 @@ error: using a potentially dangerous silent `as` conversion
LL | let i = 0u32 as u64; LL | let i = 0u32 as u64;
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: `-D clippy::as-conversions` implied by `-D warnings`
= help: consider using a safe wrapper for this conversion = help: consider using a safe wrapper for this conversion
= note: `-D clippy::as-conversions` implied by `-D warnings`
error: using a potentially dangerous silent `as` conversion error: using a potentially dangerous silent `as` conversion
--> $DIR/as_conversions.rs:17:13 --> $DIR/as_conversions.rs:17:13

View File

@ -4,8 +4,8 @@ error: Intel x86 assembly syntax used
LL | asm!(""); LL | asm!("");
| ^^^^^^^^ | ^^^^^^^^
| |
= note: `-D clippy::inline-asm-x86-intel-syntax` implied by `-D warnings`
= help: use AT&T x86 assembly syntax = help: use AT&T x86 assembly syntax
= note: `-D clippy::inline-asm-x86-intel-syntax` implied by `-D warnings`
error: Intel x86 assembly syntax used error: Intel x86 assembly syntax used
--> $DIR/asm_syntax.rs:9:9 --> $DIR/asm_syntax.rs:9:9
@ -29,8 +29,8 @@ error: AT&T x86 assembly syntax used
LL | asm!("", options(att_syntax)); LL | asm!("", options(att_syntax));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::inline-asm-x86-att-syntax` implied by `-D warnings`
= help: use Intel x86 assembly syntax = help: use Intel x86 assembly syntax
= note: `-D clippy::inline-asm-x86-att-syntax` implied by `-D warnings`
error: AT&T x86 assembly syntax used error: AT&T x86 assembly syntax used
--> $DIR/asm_syntax.rs:24:9 --> $DIR/asm_syntax.rs:24:9

View File

@ -4,8 +4,8 @@ error: `assert!(true)` will be optimized out by the compiler
LL | assert!(true); LL | assert!(true);
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
= help: remove it = help: remove it
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
error: `assert!(false)` should probably be replaced error: `assert!(false)` should probably be replaced
--> $DIR/assertions_on_constants.rs:11:5 --> $DIR/assertions_on_constants.rs:11:5

View File

@ -4,7 +4,6 @@ error: this `MutexGuard` is held across an `await` point
LL | let guard = x.lock().unwrap(); LL | let guard = x.lock().unwrap();
| ^^^^^ | ^^^^^
| |
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
note: these are all the `await` points this lock is held through note: these are all the `await` points this lock is held through
--> $DIR/await_holding_lock.rs:9:9 --> $DIR/await_holding_lock.rs:9:9
@ -13,6 +12,7 @@ LL | / let guard = x.lock().unwrap();
LL | | baz().await LL | | baz().await
LL | | } LL | | }
| |_____^ | |_____^
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
error: this `MutexGuard` is held across an `await` point error: this `MutexGuard` is held across an `await` point
--> $DIR/await_holding_lock.rs:24:13 --> $DIR/await_holding_lock.rs:24:13

View File

@ -4,7 +4,6 @@ error: this `RefCell` reference is held across an `await` point
LL | let b = x.borrow(); LL | let b = x.borrow();
| ^ | ^
| |
= note: `-D clippy::await-holding-refcell-ref` implied by `-D warnings`
= help: ensure the reference is dropped before calling `await` = help: ensure the reference is dropped before calling `await`
note: these are all the `await` points this reference is held through note: these are all the `await` points this reference is held through
--> $DIR/await_holding_refcell_ref.rs:6:5 --> $DIR/await_holding_refcell_ref.rs:6:5
@ -13,6 +12,7 @@ LL | / let b = x.borrow();
LL | | baz().await LL | | baz().await
LL | | } LL | | }
| |_^ | |_^
= note: `-D clippy::await-holding-refcell-ref` implied by `-D warnings`
error: this `RefCell` reference is held across an `await` point error: this `RefCell` reference is held across an `await` point
--> $DIR/await_holding_refcell_ref.rs:11:9 --> $DIR/await_holding_refcell_ref.rs:11:9

View File

@ -4,8 +4,8 @@ error: restriction lints are not meant to be all enabled
LL | #![warn(clippy::restriction)] LL | #![warn(clippy::restriction)]
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
= help: try enabling only the lints you really need = help: try enabling only the lints you really need
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
error: restriction lints are not meant to be all enabled error: restriction lints are not meant to be all enabled
--> $DIR/blanket_clippy_restriction_lints.rs:5:9 --> $DIR/blanket_clippy_restriction_lints.rs:5:9

View File

@ -8,8 +8,8 @@ LL | | 0
LL | | }; LL | | };
| |_____^ help: replace with from: `i32::from(a)` | |_____^ help: replace with from: `i32::from(a)`
| |
= note: `-D clippy::bool-to-int-with-if` implied by `-D warnings`
= note: `a as i32` or `a.into()` can also be valid options = note: `a as i32` or `a.into()` can also be valid options
= note: `-D clippy::bool-to-int-with-if` implied by `-D warnings`
error: boolean to int conversion using if error: boolean to int conversion using if
--> $DIR/bool_to_int_with_if.rs:20:5 --> $DIR/bool_to_int_with_if.rs:20:5

View File

@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
LL | let _ = &UNFROZEN_VARIANT; //~ ERROR interior mutability LL | let _ = &UNFROZEN_VARIANT; //~ ERROR interior mutability
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
= help: assign this const to a local or static variable, and use the variable here = help: assign this const to a local or static variable, and use the variable here
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
error: a `const` item with interior mutability should not be borrowed error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:37:18 --> $DIR/enums.rs:37:18

View File

@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
| ^^^^^^ | ^^^^^^
| |
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
= help: assign this const to a local or static variable, and use the variable here = help: assign this const to a local or static variable, and use the variable here
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
error: a `const` item with interior mutability should not be borrowed error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:55:16 --> $DIR/others.rs:55:16

View File

@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
LL | let _ = &Self::ATOMIC; //~ ERROR interior mutable LL | let _ = &Self::ATOMIC; //~ ERROR interior mutable
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
= help: assign this const to a local or static variable, and use the variable here = help: assign this const to a local or static variable, and use the variable here
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
error: a `const` item with interior mutability should not be borrowed error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:26:18 --> $DIR/traits.rs:26:18

View File

@ -4,8 +4,8 @@ error: you seem to be trying to use `Box<Vec<..>>`. Consider using just `Vec<..>
LL | fn test1(foo: Box<Vec<bool>>) {} LL | fn test1(foo: Box<Vec<bool>>) {}
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= note: `-D clippy::box-collection` implied by `-D warnings`
= help: `Vec<..>` is already on the heap, `Box<Vec<..>>` makes an extra allocation = help: `Vec<..>` is already on the heap, `Box<Vec<..>>` makes an extra allocation
= note: `-D clippy::box-collection` implied by `-D warnings`
error: you seem to be trying to use `Box<String>`. Consider using just `String` error: you seem to be trying to use `Box<String>`. Consider using just `String`
--> $DIR/box_collection.rs:28:15 --> $DIR/box_collection.rs:28:15

View File

@ -7,12 +7,12 @@ LL | | result
LL | | }; LL | | };
| |_____^ | |_____^
| |
= note: the end suggestion probably needs some adjustments to use the expression result correctly
note: the lint level is defined here note: the lint level is defined here
--> $DIR/shared_at_bottom.rs:2:36 --> $DIR/shared_at_bottom.rs:2:36
| |
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the end suggestion probably needs some adjustments to use the expression result correctly
help: consider moving these statements after the if help: consider moving these statements after the if
| |
LL ~ } LL ~ }

View File

@ -103,11 +103,6 @@ LL | | println!("This should trigger `IS_SAME_THAN_ELSE` as usual");
LL | | } else { LL | | } else {
| |_____^ | |_____^
| |
note: the lint level is defined here
--> $DIR/shared_at_top.rs:2:9
|
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
note: same as this note: same as this
--> $DIR/shared_at_top.rs:98:12 --> $DIR/shared_at_top.rs:98:12
| |
@ -116,6 +111,11 @@ LL | } else {
LL | | println!("This should trigger `IS_SAME_THAN_ELSE` as usual"); LL | | println!("This should trigger `IS_SAME_THAN_ELSE` as usual");
LL | | } LL | | }
| |_____^ | |_____^
note: the lint level is defined here
--> $DIR/shared_at_top.rs:2:9
|
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 7 previous errors error: aborting due to 7 previous errors

View File

@ -7,17 +7,17 @@ LL | | let _overlap_start = t * 2;
LL | | let _overlap_end = 2 * t; LL | | let _overlap_end = 2 * t;
| |_________________________________^ | |_________________________________^
| |
note: the lint level is defined here
--> $DIR/shared_at_top_and_bottom.rs:2:36
|
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: this code is shared at the end note: this code is shared at the end
--> $DIR/shared_at_top_and_bottom.rs:28:5 --> $DIR/shared_at_top_and_bottom.rs:28:5
| |
LL | / let _u = 9; LL | / let _u = 9;
LL | | } LL | | }
| |_____^ | |_____^
note: the lint level is defined here
--> $DIR/shared_at_top_and_bottom.rs:2:36
|
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider moving these statements before the if help: consider moving these statements before the if
| |
LL ~ let t = 7; LL ~ let t = 7;

View File

@ -6,11 +6,6 @@ LL | if false {
LL | | } else { LL | | } else {
| |_____^ | |_____^
| |
note: the lint level is defined here
--> $DIR/valid_if_blocks.rs:2:9
|
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
note: same as this note: same as this
--> $DIR/valid_if_blocks.rs:105:12 --> $DIR/valid_if_blocks.rs:105:12
| |
@ -18,6 +13,11 @@ LL | } else {
| ____________^ | ____________^
LL | | } LL | | }
| |_____^ | |_____^
note: the lint level is defined here
--> $DIR/valid_if_blocks.rs:2:9
|
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: this `if` has identical blocks error: this `if` has identical blocks
--> $DIR/valid_if_blocks.rs:115:15 --> $DIR/valid_if_blocks.rs:115:15

View File

@ -4,8 +4,8 @@ error: case-sensitive file extension comparison
LL | filename.ends_with(".rs") LL | filename.ends_with(".rs")
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::case-sensitive-file-extension-comparisons` implied by `-D warnings`
= help: consider using a case-insensitive comparison instead = help: consider using a case-insensitive comparison instead
= note: `-D clippy::case-sensitive-file-extension-comparisons` implied by `-D warnings`
error: case-sensitive file extension comparison error: case-sensitive file extension comparison
--> $DIR/case_sensitive_file_extension_comparisons.rs:17:27 --> $DIR/case_sensitive_file_extension_comparisons.rs:17:27

View File

@ -4,8 +4,8 @@ error: casting a character literal to `u8` truncates
LL | let _ = '❤' as u8; // no suggestion, since a byte literal won't work. LL | let _ = '❤' as u8; // no suggestion, since a byte literal won't work.
| ^^^^^^^^^ | ^^^^^^^^^
| |
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
= note: `char` is four bytes wide, but `u8` is a single byte = note: `char` is four bytes wide, but `u8` is a single byte
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: casting a character literal to `u8` truncates
LL | let _ = 'a' as u8; LL | let _ = 'a' as u8;
| ^^^^^^^^^ help: use a byte literal instead: `b'a'` | ^^^^^^^^^ help: use a byte literal instead: `b'a'`
| |
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
= note: `char` is four bytes wide, but `u8` is a single byte = note: `char` is four bytes wide, but `u8` is a single byte
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
error: casting a character literal to `u8` truncates error: casting a character literal to `u8` truncates
--> $DIR/char_lit_as_u8_suggestions.rs:7:13 --> $DIR/char_lit_as_u8_suggestions.rs:7:13

View File

@ -6,12 +6,12 @@ LL | if x.is_ok() && y.is_err() {
LL | x.unwrap(); // unnecessary LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= help: try using `if let` or `match`
note: the lint level is defined here note: the lint level is defined here
--> $DIR/complex_conditionals.rs:1:35 --> $DIR/complex_conditionals.rs:1:35
| |
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)] LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: try using `if let` or `match`
error: this call to `unwrap_err()` will always panic error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:9:9 --> $DIR/complex_conditionals.rs:9:9

View File

@ -4,8 +4,8 @@ error: the function has a cognitive complexity of (28/25)
LL | fn main() { LL | fn main() {
| ^^^^ | ^^^^
| |
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: you could split it up into multiple smaller functions = help: you could split it up into multiple smaller functions
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
error: the function has a cognitive complexity of (7/1) error: the function has a cognitive complexity of (7/1)
--> $DIR/cognitive_complexity.rs:91:4 --> $DIR/cognitive_complexity.rs:91:4

View File

@ -4,8 +4,8 @@ error: the function has a cognitive complexity of (3/0)
LL | fn kaboom() { LL | fn kaboom() {
| ^^^^^^ | ^^^^^^
| |
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: you could split it up into multiple smaller functions = help: you could split it up into multiple smaller functions
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -8,7 +8,6 @@ LL | | _ => return,
LL | | }, LL | | },
| |_________^ | |_________^
| |
= note: `-D clippy::collapsible-match` implied by `-D warnings`
help: the outer pattern can be modified to include the inner pattern help: the outer pattern can be modified to include the inner pattern
--> $DIR/collapsible_match.rs:12:12 --> $DIR/collapsible_match.rs:12:12
| |
@ -16,6 +15,7 @@ LL | Ok(val) => match val {
| ^^^ replace this binding | ^^^ replace this binding
LL | Some(n) => foo(n), LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern | ^^^^^^^ with this pattern
= note: `-D clippy::collapsible-match` implied by `-D warnings`
error: this `match` can be collapsed into the outer `match` error: this `match` can be collapsed into the outer `match`
--> $DIR/collapsible_match.rs:21:20 --> $DIR/collapsible_match.rs:21:20

View File

@ -8,7 +8,6 @@ LL | | _ => return,
LL | | }, LL | | },
| |_____________^ | |_____________^
| |
= note: `-D clippy::collapsible-match` implied by `-D warnings`
help: the outer pattern can be modified to include the inner pattern help: the outer pattern can be modified to include the inner pattern
--> $DIR/collapsible_match2.rs:13:16 --> $DIR/collapsible_match2.rs:13:16
| |
@ -16,6 +15,7 @@ LL | Ok(val) if make() => match val {
| ^^^ replace this binding | ^^^ replace this binding
LL | Some(n) => foo(n), LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern | ^^^^^^^ with this pattern
= note: `-D clippy::collapsible-match` implied by `-D warnings`
error: this `match` can be collapsed into the outer `match` error: this `match` can be collapsed into the outer `match`
--> $DIR/collapsible_match2.rs:20:24 --> $DIR/collapsible_match2.rs:20:24

View File

@ -8,8 +8,8 @@ LL | | b()
LL | | } LL | | }
| |_____^ | |_____^
| |
= note: `-D clippy::comparison-chain` implied by `-D warnings`
= help: consider rewriting the `if` chain to use `cmp` and `match` = help: consider rewriting the `if` chain to use `cmp` and `match`
= note: `-D clippy::comparison-chain` implied by `-D warnings`
error: `if` chain can be rewritten with `match` error: `if` chain can be rewritten with `match`
--> $DIR/comparison_chain.rs:27:5 --> $DIR/comparison_chain.rs:27:5

View File

@ -10,8 +10,8 @@ LL | | }
LL | | } LL | | }
| |_^ | |_^
| |
= note: `-D clippy::copy-iterator` implied by `-D warnings`
= note: consider implementing `IntoIterator` instead = note: consider implementing `IntoIterator` instead
= note: `-D clippy::copy-iterator` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -18,8 +18,8 @@ error: empty `loop {}` wastes CPU cycles
LL | loop {} LL | loop {}
| ^^^^^^^ | ^^^^^^^
| |
= note: `-D clippy::empty-loop` implied by `-D warnings`
= help: you should either use `panic!()` or add `std::thread::sleep(..);` to the loop body = help: you should either use `panic!()` or add `std::thread::sleep(..);` to the loop body
= note: `-D clippy::empty-loop` implied by `-D warnings`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,9 +4,9 @@ error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated wit
LL | FOO_REF_REF => {}, LL | FOO_REF_REF => {},
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: `-D indirect-structural-match` implied by `-D warnings`
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411> = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
= note: `-D indirect-structural-match` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: unsafe block missing a safety comment
LL | unsafe { 0 }; LL | unsafe { 0 };
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: `-D clippy::undocumented-unsafe-blocks` implied by `-D warnings`
= help: consider adding a safety comment on the preceding line = help: consider adding a safety comment on the preceding line
= note: `-D clippy::undocumented-unsafe-blocks` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -8,8 +8,8 @@ LL | | TyöValmis,
LL | | } LL | | }
| |_^ | |_^
| |
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
= help: remove the prefixes and use full paths to the variants instead of glob imports = help: remove the prefixes and use full paths to the variants instead of glob imports
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -22,8 +22,8 @@ error: literal out of range for `u32`
LL | let _y = 1u32 >> 10000000000000u32; LL | let _y = 1u32 >> 10000000000000u32;
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= note: `#[deny(overflowing_literals)]` on by default
= note: the literal `10000000000000u32` does not fit into the type `u32` whose range is `0..=4294967295` = note: the literal `10000000000000u32` does not fit into the type `u32` whose range is `0..=4294967295`
= note: `#[deny(overflowing_literals)]` on by default
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -4,8 +4,8 @@ error: recursing into entrypoint `a`
LL | a(); LL | a();
| ^ | ^
| |
= note: `-D clippy::main-recursion` implied by `-D warnings`
= help: consider using another function for this recursion = help: consider using another function for this recursion
= note: `-D clippy::main-recursion` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -5,8 +5,8 @@ LL | / a = b;
LL | | b = a; LL | | b = a;
| |_________^ help: try: `core::mem::swap(&mut a, &mut b)` | |_________^ help: try: `core::mem::swap(&mut a, &mut b)`
| |
= note: `-D clippy::almost-swapped` implied by `-D warnings`
= note: or maybe you should use `core::mem::replace`? = note: or maybe you should use `core::mem::replace`?
= note: `-D clippy::almost-swapped` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: recursing into entrypoint `main`
LL | main(); LL | main();
| ^^^^ | ^^^^
| |
= note: `-D clippy::main-recursion` implied by `-D warnings`
= help: consider using another function for this recursion = help: consider using another function for this recursion
= note: `-D clippy::main-recursion` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: methods called `as_*` usually take `self` by reference or `self` by mutab
LL | pub fn as_ref(self) -> &'static str { LL | pub fn as_ref(self) -> &'static str {
| ^^^^ | ^^^^
| |
= note: `-D clippy::wrong-self-convention` implied by `-D warnings`
= help: consider choosing a less ambiguous name = help: consider choosing a less ambiguous name
= note: `-D clippy::wrong-self-convention` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -7,8 +7,8 @@ LL | | b: u32,
LL | | } LL | | }
| |_^ | |_^
| |
= note: `-D clippy::default-union-representation` implied by `-D warnings`
= help: consider annotating `NoAttribute` with `#[repr(C)]` to explicitly specify memory layout = help: consider annotating `NoAttribute` with `#[repr(C)]` to explicitly specify memory layout
= note: `-D clippy::default-union-representation` implied by `-D warnings`
error: this union has the default representation error: this union has the default representation
--> $DIR/default_union_representation.rs:16:1 --> $DIR/default_union_representation.rs:16:1

View File

@ -8,7 +8,6 @@ LL | | }
LL | | } LL | | }
| |_^ | |_^
| |
= note: `-D clippy::expl-impl-clone-on-copy` implied by `-D warnings`
note: consider deriving `Clone` or removing `Copy` note: consider deriving `Clone` or removing `Copy`
--> $DIR/derive.rs:8:1 --> $DIR/derive.rs:8:1
| |
@ -18,6 +17,7 @@ LL | | Qux
LL | | } LL | | }
LL | | } LL | | }
| |_^ | |_^
= note: `-D clippy::expl-impl-clone-on-copy` implied by `-D warnings`
error: you are implementing `Clone` explicitly on a `Copy` type error: you are implementing `Clone` explicitly on a `Copy` type
--> $DIR/derive.rs:32:1 --> $DIR/derive.rs:32:1

View File

@ -4,12 +4,12 @@ error: you are deriving `Hash` but have implemented `PartialEq` explicitly
LL | #[derive(Hash)] LL | #[derive(Hash)]
| ^^^^ | ^^^^
| |
= note: `#[deny(clippy::derive_hash_xor_eq)]` on by default
note: `PartialEq` implemented here note: `PartialEq` implemented here
--> $DIR/derive_hash_xor_eq.rs:15:1 --> $DIR/derive_hash_xor_eq.rs:15:1
| |
LL | impl PartialEq for Bar { LL | impl PartialEq for Bar {
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::derive_hash_xor_eq)]` on by default
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: you are deriving `Hash` but have implemented `PartialEq` explicitly error: you are deriving `Hash` but have implemented `PartialEq` explicitly

View File

@ -4,12 +4,12 @@ error: you are deriving `Ord` but have implemented `PartialOrd` explicitly
LL | #[derive(Ord, PartialEq, Eq)] LL | #[derive(Ord, PartialEq, Eq)]
| ^^^ | ^^^
| |
= note: `-D clippy::derive-ord-xor-partial-ord` implied by `-D warnings`
note: `PartialOrd` implemented here note: `PartialOrd` implemented here
--> $DIR/derive_ord_xor_partial_ord.rs:24:1 --> $DIR/derive_ord_xor_partial_ord.rs:24:1
| |
LL | impl PartialOrd for DeriveOrd { LL | impl PartialOrd for DeriveOrd {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D clippy::derive-ord-xor-partial-ord` implied by `-D warnings`
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
error: you are deriving `Ord` but have implemented `PartialOrd` explicitly error: you are deriving `Ord` but have implemented `PartialOrd` explicitly

View File

@ -7,8 +7,8 @@ LL | | /// Because of the initial `unbalanced_tick` pair, the error message is
LL | | /// very `confusing_and_misleading`. LL | | /// very `confusing_and_misleading`.
| |____________________________________^ | |____________________________________^
| |
= note: `-D clippy::doc-markdown` implied by `-D warnings`
= help: a backtick may be missing a pair = help: a backtick may be missing a pair
= note: `-D clippy::doc-markdown` implied by `-D warnings`
error: backticks are unbalanced error: backticks are unbalanced
--> $DIR/unbalanced_ticks.rs:13:1 --> $DIR/unbalanced_ticks.rs:13:1

View File

@ -4,8 +4,8 @@ error: this function has an empty `#[must_use]` attribute, but returns a type al
LL | pub fn must_use_result() -> Result<(), ()> { LL | pub fn must_use_result() -> Result<(), ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::double-must-use` implied by `-D warnings`
= help: either add some descriptive text or remove the attribute = help: either add some descriptive text or remove the attribute
= note: `-D clippy::double-must-use` implied by `-D warnings`
error: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]` error: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]`
--> $DIR/double_must_use.rs:10:1 --> $DIR/double_must_use.rs:10:1

View File

@ -4,12 +4,12 @@ error: calls to `std::mem::drop` with a value that implements `Copy`. Dropping a
LL | drop(s1); LL | drop(s1);
| ^^^^^^^^ | ^^^^^^^^
| |
= note: `-D clippy::drop-copy` implied by `-D warnings`
note: argument has type `SomeStruct` note: argument has type `SomeStruct`
--> $DIR/drop_forget_copy.rs:33:10 --> $DIR/drop_forget_copy.rs:33:10
| |
LL | drop(s1); LL | drop(s1);
| ^^ | ^^
= note: `-D clippy::drop-copy` implied by `-D warnings`
error: calls to `std::mem::drop` with a value that implements `Copy`. Dropping a copy leaves the original intact error: calls to `std::mem::drop` with a value that implements `Copy`. Dropping a copy leaves the original intact
--> $DIR/drop_forget_copy.rs:34:5 --> $DIR/drop_forget_copy.rs:34:5
@ -41,12 +41,12 @@ error: calls to `std::mem::forget` with a value that implements `Copy`. Forgetti
LL | forget(s1); LL | forget(s1);
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= note: `-D clippy::forget-copy` implied by `-D warnings`
note: argument has type `SomeStruct` note: argument has type `SomeStruct`
--> $DIR/drop_forget_copy.rs:39:12 --> $DIR/drop_forget_copy.rs:39:12
| |
LL | forget(s1); LL | forget(s1);
| ^^ | ^^
= note: `-D clippy::forget-copy` implied by `-D warnings`
error: calls to `std::mem::forget` with a value that implements `Copy`. Forgetting a copy leaves the original intact error: calls to `std::mem::forget` with a value that implements `Copy`. Forgetting a copy leaves the original intact
--> $DIR/drop_forget_copy.rs:40:5 --> $DIR/drop_forget_copy.rs:40:5

View File

@ -4,12 +4,12 @@ error: call to `std::mem::drop` with a value that does not implement `Drop`. Dro
LL | drop(Foo); LL | drop(Foo);
| ^^^^^^^^^ | ^^^^^^^^^
| |
= note: `-D clippy::drop-non-drop` implied by `-D warnings`
note: argument has type `main::Foo` note: argument has type `main::Foo`
--> $DIR/drop_non_drop.rs:22:10 --> $DIR/drop_non_drop.rs:22:10
| |
LL | drop(Foo); LL | drop(Foo);
| ^^^ | ^^^
= note: `-D clippy::drop-non-drop` implied by `-D warnings`
error: call to `std::mem::drop` with a value that does not implement `Drop`. Dropping such a type only extends its contained lifetimes error: call to `std::mem::drop` with a value that does not implement `Drop`. Dropping such a type only extends its contained lifetimes
--> $DIR/drop_non_drop.rs:37:5 --> $DIR/drop_non_drop.rs:37:5

View File

@ -4,12 +4,12 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro
LL | drop(&SomeStruct); LL | drop(&SomeStruct);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::drop-ref` implied by `-D warnings`
note: argument has type `&SomeStruct` note: argument has type `&SomeStruct`
--> $DIR/drop_ref.rs:11:10 --> $DIR/drop_ref.rs:11:10
| |
LL | drop(&SomeStruct); LL | drop(&SomeStruct);
| ^^^^^^^^^^^ | ^^^^^^^^^^^
= note: `-D clippy::drop-ref` implied by `-D warnings`
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing
--> $DIR/drop_ref.rs:14:5 --> $DIR/drop_ref.rs:14:5

View File

@ -8,8 +8,8 @@ LL | | println!("else if");
LL | | } LL | | }
| |_____^ | |_____^
| |
= note: `-D clippy::else-if-without-else` implied by `-D warnings`
= help: add an `else` block here = help: add an `else` block here
= note: `-D clippy::else-if-without-else` implied by `-D warnings`
error: `if` expression with an `else if`, but without a final `else` error: `if` expression with an `else if`, but without a final `else`
--> $DIR/else_if_without_else.rs:54:12 --> $DIR/else_if_without_else.rs:54:12

View File

@ -4,8 +4,8 @@ error: enum with no variants
LL | enum Empty {} LL | enum Empty {}
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= note: `-D clippy::empty-enum` implied by `-D warnings`
= help: consider using the uninhabited type `!` (never type) or a wrapper around it to introduce a type which can't be instantiated = help: consider using the uninhabited type `!` (never type) or a wrapper around it to introduce a type which can't be instantiated
= note: `-D clippy::empty-enum` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: empty `loop {}` wastes CPU cycles
LL | loop {} LL | loop {}
| ^^^^^^^ | ^^^^^^^
| |
= note: `-D clippy::empty-loop` implied by `-D warnings`
= help: you should either use `panic!()` or add `std::thread::sleep(..);` to the loop body = help: you should either use `panic!()` or add `std::thread::sleep(..);` to the loop body
= note: `-D clippy::empty-loop` implied by `-D warnings`
error: empty `loop {}` wastes CPU cycles error: empty `loop {}` wastes CPU cycles
--> $DIR/empty_loop.rs:11:9 --> $DIR/empty_loop.rs:11:9

View File

@ -4,8 +4,8 @@ error: empty `loop {}` wastes CPU cycles
LL | loop {} LL | loop {}
| ^^^^^^^ | ^^^^^^^
| |
= note: `-D clippy::empty-loop` implied by `-D warnings`
= help: you should either use `panic!()` or add a call pausing or sleeping the thread to the loop body = help: you should either use `panic!()` or add a call pausing or sleeping the thread to the loop body
= note: `-D clippy::empty-loop` implied by `-D warnings`
error: empty `loop {}` wastes CPU cycles error: empty `loop {}` wastes CPU cycles
--> $DIR/empty_loop_no_std.rs:25:5 --> $DIR/empty_loop_no_std.rs:25:5

View File

@ -4,8 +4,8 @@ error: used `expect()` on `an Option` value
LL | let _ = opt.expect(""); LL | let _ = opt.expect("");
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= note: `-D clippy::expect-used` implied by `-D warnings`
= help: if this value is `None`, it will panic = help: if this value is `None`, it will panic
= note: `-D clippy::expect-used` implied by `-D warnings`
error: used `expect()` on `a Result` value error: used `expect()` on `a Result` value
--> $DIR/expect.rs:10:13 --> $DIR/expect.rs:10:13

View File

@ -8,17 +8,17 @@ LL | | }
LL | | } LL | | }
| |_^ | |_^
| |
note: the lint level is defined here
--> $DIR/fallible_impl_from.rs:1:9
|
LL | #![deny(clippy::fallible_impl_from)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail
note: potential failure(s) note: potential failure(s)
--> $DIR/fallible_impl_from.rs:7:13 --> $DIR/fallible_impl_from.rs:7:13
| |
LL | Foo(s.parse().unwrap()) LL | Foo(s.parse().unwrap())
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
note: the lint level is defined here
--> $DIR/fallible_impl_from.rs:1:9
|
LL | #![deny(clippy::fallible_impl_from)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: consider implementing `TryFrom` instead error: consider implementing `TryFrom` instead
--> $DIR/fallible_impl_from.rs:26:1 --> $DIR/fallible_impl_from.rs:26:1

View File

@ -4,12 +4,12 @@ error: field assignment outside of initializer for an instance created with Defa
LL | a.i = 42; LL | a.i = 42;
| ^^^^^^^^^ | ^^^^^^^^^
| |
= note: `-D clippy::field-reassign-with-default` implied by `-D warnings`
note: consider initializing the variable with `main::A { i: 42, ..Default::default() }` and removing relevant reassignments note: consider initializing the variable with `main::A { i: 42, ..Default::default() }` and removing relevant reassignments
--> $DIR/field_reassign_with_default.rs:62:5 --> $DIR/field_reassign_with_default.rs:62:5
| |
LL | let mut a: A = Default::default(); LL | let mut a: A = Default::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D clippy::field-reassign-with-default` implied by `-D warnings`
error: field assignment outside of initializer for an instance created with Default::default() error: field assignment outside of initializer for an instance created with Default::default()
--> $DIR/field_reassign_with_default.rs:103:5 --> $DIR/field_reassign_with_default.rs:103:5

View File

@ -4,8 +4,8 @@ error: `FileType::is_file()` only covers regular files
LL | if fs::metadata("foo.txt")?.file_type().is_file() { LL | if fs::metadata("foo.txt")?.file_type().is_file() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::filetype-is-file` implied by `-D warnings`
= help: use `!FileType::is_dir()` instead = help: use `!FileType::is_dir()` instead
= note: `-D clippy::filetype-is-file` implied by `-D warnings`
error: `!FileType::is_file()` only denies regular files error: `!FileType::is_file()` only denies regular files
--> $DIR/filetype_is_file.rs:13:8 --> $DIR/filetype_is_file.rs:13:8

View File

@ -4,8 +4,8 @@ error: strict comparison of `f32` or `f64`
LL | ONE as f64 != 2.0; LL | ONE as f64 != 2.0;
| ^^^^^^^^^^^^^^^^^ help: consider comparing them within some margin of error: `(ONE as f64 - 2.0).abs() > error_margin` | ^^^^^^^^^^^^^^^^^ help: consider comparing them within some margin of error: `(ONE as f64 - 2.0).abs() > error_margin`
| |
= note: `-D clippy::float-cmp` implied by `-D warnings`
= note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin` = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
= note: `-D clippy::float-cmp` implied by `-D warnings`
error: strict comparison of `f32` or `f64` error: strict comparison of `f32` or `f64`
--> $DIR/float_cmp.rs:62:5 --> $DIR/float_cmp.rs:62:5

View File

@ -4,8 +4,8 @@ error: strict comparison of `f32` or `f64` constant
LL | 1f32 == ONE; LL | 1f32 == ONE;
| ^^^^^^^^^^^ help: consider comparing them within some margin of error: `(1f32 - ONE).abs() < error_margin` | ^^^^^^^^^^^ help: consider comparing them within some margin of error: `(1f32 - ONE).abs() < error_margin`
| |
= note: `-D clippy::float-cmp-const` implied by `-D warnings`
= note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin` = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
= note: `-D clippy::float-cmp-const` implied by `-D warnings`
error: strict comparison of `f32` or `f64` constant error: strict comparison of `f32` or `f64` constant
--> $DIR/float_cmp_const.rs:17:5 --> $DIR/float_cmp_const.rs:17:5

View File

@ -4,8 +4,8 @@ error: more than 3 bools in function parameters
LL | fn g(_: bool, _: bool, _: bool, _: bool) {} LL | fn g(_: bool, _: bool, _: bool, _: bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
= help: consider refactoring bools into two-variant enums = help: consider refactoring bools into two-variant enums
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
error: more than 3 bools in function parameters error: more than 3 bools in function parameters
--> $DIR/fn_params_excessive_bools.rs:21:1 --> $DIR/fn_params_excessive_bools.rs:21:1

View File

@ -4,8 +4,8 @@ error: for loop over `option`, which is an `Option`. This is more readably writt
LL | for x in option { LL | for x in option {
| ^^^^^^ | ^^^^^^
| |
= note: `-D clippy::for-loops-over-fallibles` implied by `-D warnings`
= help: consider replacing `for x in option` with `if let Some(x) = option` = help: consider replacing `for x in option` with `if let Some(x) = option`
= note: `-D clippy::for-loops-over-fallibles` implied by `-D warnings`
error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement
--> $DIR/for_loops_over_fallibles.rs:14:14 --> $DIR/for_loops_over_fallibles.rs:14:14

View File

@ -4,12 +4,12 @@ error: call to `std::mem::forget` with a value that does not implement `Drop`. F
LL | forget(Foo); LL | forget(Foo);
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: `-D clippy::forget-non-drop` implied by `-D warnings`
note: argument has type `main::Foo` note: argument has type `main::Foo`
--> $DIR/forget_non_drop.rs:13:12 --> $DIR/forget_non_drop.rs:13:12
| |
LL | forget(Foo); LL | forget(Foo);
| ^^^ | ^^^
= note: `-D clippy::forget-non-drop` implied by `-D warnings`
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> $DIR/forget_non_drop.rs:24:5 --> $DIR/forget_non_drop.rs:24:5

View File

@ -4,12 +4,12 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F
LL | forget(&SomeStruct); LL | forget(&SomeStruct);
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::forget-ref` implied by `-D warnings`
note: argument has type `&SomeStruct` note: argument has type `&SomeStruct`
--> $DIR/forget_ref.rs:11:12 --> $DIR/forget_ref.rs:11:12
| |
LL | forget(&SomeStruct); LL | forget(&SomeStruct);
| ^^^^^^^^^^^ | ^^^^^^^^^^^
= note: `-D clippy::forget-ref` implied by `-D warnings`
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
--> $DIR/forget_ref.rs:14:5 --> $DIR/forget_ref.rs:14:5

View File

@ -4,9 +4,9 @@ error: `format!` in `println!` args
LL | println!("error: {}", format!("something failed at {}", Location::caller())); LL | println!("error: {}", format!("something failed at {}", Location::caller()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::format-in-format-args` implied by `-D warnings`
= help: combine the `format!(..)` arguments with the outer `println!(..)` call = help: combine the `format!(..)` arguments with the outer `println!(..)` call
= help: or consider changing `format!` to `format_args!` = help: or consider changing `format!` to `format_args!`
= note: `-D clippy::format-in-format-args` implied by `-D warnings`
error: `format!` in `println!` args error: `format!` in `println!` args
--> $DIR/format_args_unfixable.rs:28:5 --> $DIR/format_args_unfixable.rs:28:5

View File

@ -4,8 +4,8 @@ error: `format!(..)` appended to existing `String`
LL | string += &format!("{:?}", 1234); LL | string += &format!("{:?}", 1234);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::format-push-string` implied by `-D warnings`
= help: consider using `write!` to avoid the extra allocation = help: consider using `write!` to avoid the extra allocation
= note: `-D clippy::format-push-string` implied by `-D warnings`
error: `format!(..)` appended to existing `String` error: `format!(..)` appended to existing `String`
--> $DIR/format_push_string.rs:6:5 --> $DIR/format_push_string.rs:6:5

View File

@ -4,8 +4,8 @@ error: this looks like you are trying to use `.. -= ..`, but you really are doin
LL | a =- 35; LL | a =- 35;
| ^^^^ | ^^^^
| |
= note: `-D clippy::suspicious-assignment-formatting` implied by `-D warnings`
= note: to remove this lint, use either `-=` or `= -` = note: to remove this lint, use either `-=` or `= -`
= note: `-D clippy::suspicious-assignment-formatting` implied by `-D warnings`
error: this looks like you are trying to use `.. *= ..`, but you really are doing `.. = (* ..)` error: this looks like you are trying to use `.. *= ..`, but you really are doing `.. = (* ..)`
--> $DIR/formatting.rs:17:6 --> $DIR/formatting.rs:17:6
@ -29,8 +29,8 @@ error: possibly missing a comma here
LL | -1, -2, -3 // <= no comma here LL | -1, -2, -3 // <= no comma here
| ^ | ^
| |
= note: `-D clippy::possible-missing-comma` implied by `-D warnings`
= note: to remove this lint, add a comma or write the expr in a single line = note: to remove this lint, add a comma or write the expr in a single line
= note: `-D clippy::possible-missing-comma` implied by `-D warnings`
error: possibly missing a comma here error: possibly missing a comma here
--> $DIR/formatting.rs:33:19 --> $DIR/formatting.rs:33:19

View File

@ -4,8 +4,8 @@ error: an implementation of `From` is preferred since it gives you `Into<_>` for
LL | impl Into<StringWrapper> for String { LL | impl Into<StringWrapper> for String {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::from-over-into` implied by `-D warnings`
= help: consider to implement `From<std::string::String>` instead = help: consider to implement `From<std::string::String>` instead
= note: `-D clippy::from-over-into` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,7 +4,6 @@ error: future cannot be sent between threads safely
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool { LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^ future returned by `private_future` is not `Send` | ^^^^ future returned by `private_future` is not `Send`
| |
= note: `-D clippy::future-not-send` implied by `-D warnings`
note: future is not `Send` as this value is used across an await note: future is not `Send` as this value is used across an await
--> $DIR/future_not_send.rs:8:19 --> $DIR/future_not_send.rs:8:19
| |
@ -25,6 +24,7 @@ LL | async { true }.await
LL | } LL | }
| - `cell` is later dropped here | - `cell` is later dropped here
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync` = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
= note: `-D clippy::future-not-send` implied by `-D warnings`
error: future cannot be sent between threads safely error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:11:42 --> $DIR/future_not_send.rs:11:42

View File

@ -16,8 +16,8 @@ error: used `unwrap()` on `an Option` value
LL | let _ = boxed_slice.get(1).unwrap(); LL | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::unwrap-used` implied by `-D warnings`
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
= note: `-D clippy::unwrap-used` implied by `-D warnings`
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:36:17 --> $DIR/get_unwrap.rs:36:17

View File

@ -13,8 +13,8 @@ LL | | do_stuff(lock);
LL | | }; LL | | };
| |_____^ | |_____^
| |
= note: `-D clippy::if-let-mutex` implied by `-D warnings`
= help: move the lock call outside of the `if let ...` expression = help: move the lock call outside of the `if let ...` expression
= note: `-D clippy::if-let-mutex` implied by `-D warnings`
error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
--> $DIR/if_let_mutex.rs:22:5 --> $DIR/if_let_mutex.rs:22:5

View File

@ -8,8 +8,8 @@ LL | | println!("Bunny");
LL | | } LL | | }
| |_____^ | |_____^
| |
= note: `-D clippy::if-not-else` implied by `-D warnings`
= help: remove the `!` and swap the blocks of the `if`/`else` = help: remove the `!` and swap the blocks of the `if`/`else`
= note: `-D clippy::if-not-else` implied by `-D warnings`
error: unnecessary `!=` operation error: unnecessary `!=` operation
--> $DIR/if_not_else.rs:17:5 --> $DIR/if_not_else.rs:17:5

View File

@ -11,7 +11,6 @@ LL | | foo();
LL | | } else { LL | | } else {
| |_____^ | |_____^
| |
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this note: same as this
--> $DIR/if_same_then_else.rs:31:12 --> $DIR/if_same_then_else.rs:31:12
| |
@ -24,6 +23,7 @@ LL | | 0..10;
LL | | foo(); LL | | foo();
LL | | } LL | | }
| |_____^ | |_____^
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
error: this `if` has identical blocks error: this `if` has identical blocks
--> $DIR/if_same_then_else.rs:67:21 --> $DIR/if_same_then_else.rs:67:21

View File

@ -11,7 +11,6 @@ LL | | }
LL | | } else { LL | | } else {
| |_____^ | |_____^
| |
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this note: same as this
--> $DIR/if_same_then_else2.rs:23:12 --> $DIR/if_same_then_else2.rs:23:12
| |
@ -24,6 +23,7 @@ LL | | let bar: &Option<_> = &Some::<u8>(42);
LL | | } LL | | }
LL | | } LL | | }
| |_____^ | |_____^
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
error: this `if` has identical blocks error: this `if` has identical blocks
--> $DIR/if_same_then_else2.rs:35:13 --> $DIR/if_same_then_else2.rs:35:13

View File

@ -10,8 +10,8 @@ LL | | None
LL | | }; LL | | };
| |_____^ | |_____^
| |
= note: `-D clippy::if-then-some-else-none` implied by `-D warnings`
= help: consider using `bool::then` like: `foo().then(|| { /* snippet */ "foo" })` = help: consider using `bool::then` like: `foo().then(|| { /* snippet */ "foo" })`
= note: `-D clippy::if-then-some-else-none` implied by `-D warnings`
error: this could be simplified with `bool::then` error: this could be simplified with `bool::then`
--> $DIR/if_then_some_else_none.rs:14:13 --> $DIR/if_then_some_else_none.rs:14:13

View File

@ -4,12 +4,12 @@ error: this `if` has the same condition as a previous `if`
LL | } else if b { LL | } else if b {
| ^ | ^
| |
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
note: same as this note: same as this
--> $DIR/ifs_same_cond.rs:8:8 --> $DIR/ifs_same_cond.rs:8:8
| |
LL | if b { LL | if b {
| ^ | ^
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
error: this `if` has the same condition as a previous `if` error: this `if` has the same condition as a previous `if`
--> $DIR/ifs_same_cond.rs:14:15 --> $DIR/ifs_same_cond.rs:14:15

View File

@ -6,7 +6,6 @@ LL | | fn second() {}
LL | | } LL | | }
| |_^ | |_^
| |
= note: `-D clippy::multiple-inherent-impl` implied by `-D warnings`
note: first implementation here note: first implementation here
--> $DIR/impl.rs:6:1 --> $DIR/impl.rs:6:1
| |
@ -14,6 +13,7 @@ LL | / impl MyStruct {
LL | | fn first() {} LL | | fn first() {}
LL | | } LL | | }
| |_^ | |_^
= note: `-D clippy::multiple-inherent-impl` implied by `-D warnings`
error: multiple implementations of this structure error: multiple implementations of this structure
--> $DIR/impl.rs:24:5 --> $DIR/impl.rs:24:5

View File

@ -16,8 +16,8 @@ error: indexing may panic
LL | x[index]; LL | x[index];
| ^^^^^^^^ | ^^^^^^^^
| |
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
= help: consider using `.get(n)` or `.get_mut(n)` instead = help: consider using `.get(n)` or `.get_mut(n)` instead
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
error: indexing may panic error: indexing may panic
--> $DIR/indexing_slicing_index.rs:38:5 --> $DIR/indexing_slicing_index.rs:38:5

View File

@ -4,8 +4,8 @@ error: slicing may panic
LL | &x[index..]; LL | &x[index..];
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
= help: consider using `.get(n..)` or .get_mut(n..)` instead = help: consider using `.get(n..)` or .get_mut(n..)` instead
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
error: slicing may panic error: slicing may panic
--> $DIR/indexing_slicing_slice.rs:13:6 --> $DIR/indexing_slicing_slice.rs:13:6

View File

@ -4,12 +4,12 @@ error: calling `to_string` on `&&str`
LL | let _: String = rrstr.to_string(); LL | let _: String = rrstr.to_string();
| ^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstr).to_string()` | ^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstr).to_string()`
| |
= help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
note: the lint level is defined here note: the lint level is defined here
--> $DIR/inefficient_to_string.rs:2:9 --> $DIR/inefficient_to_string.rs:2:9
| |
LL | #![deny(clippy::inefficient_to_string)] LL | #![deny(clippy::inefficient_to_string)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
error: calling `to_string` on `&&&str` error: calling `to_string` on `&&&str`
--> $DIR/inefficient_to_string.rs:12:21 --> $DIR/inefficient_to_string.rs:12:21

View File

@ -4,8 +4,8 @@ error: variables in the condition are not mutated in the loop body
LL | while y < 10 { LL | while y < 10 {
| ^^^^^^ | ^^^^^^
| |
= note: `#[deny(clippy::while_immutable_condition)]` on by default
= note: this may lead to an infinite or to a never running loop = note: this may lead to an infinite or to a never running loop
= note: `#[deny(clippy::while_immutable_condition)]` on by default
error: variables in the condition are not mutated in the loop body error: variables in the condition are not mutated in the loop body
--> $DIR/infinite_loop.rs:25:11 --> $DIR/infinite_loop.rs:25:11

View File

@ -6,8 +6,8 @@ LL | | "A.to_string()".to_string()
LL | | } LL | | }
| |_____^ | |_____^
| |
= note: `-D clippy::inherent-to-string` implied by `-D warnings`
= help: implement trait `Display` for type `A` instead = help: implement trait `Display` for type `A` instead
= note: `-D clippy::inherent-to-string` implied by `-D warnings`
error: type `C` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display` error: type `C` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display`
--> $DIR/inherent_to_string.rs:44:5 --> $DIR/inherent_to_string.rs:44:5
@ -17,12 +17,12 @@ LL | | "C.to_string()".to_string()
LL | | } LL | | }
| |_____^ | |_____^
| |
= help: remove the inherent method from type `C`
note: the lint level is defined here note: the lint level is defined here
--> $DIR/inherent_to_string.rs:2:9 --> $DIR/inherent_to_string.rs:2:9
| |
LL | #![deny(clippy::inherent_to_string_shadow_display)] LL | #![deny(clippy::inherent_to_string_shadow_display)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: remove the inherent method from type `C`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -9,8 +9,8 @@ LL | | b.push(z);
LL | | }); LL | | });
| |______^ | |______^
| |
= note: `-D clippy::inspect-for-each` implied by `-D warnings`
= help: move the code from `inspect(..)` to `for_each(..)` and remove the `inspect(..)` = help: move the code from `inspect(..)` to `for_each(..)` and remove the `inspect(..)`
= note: `-D clippy::inspect-for-each` implied by `-D warnings`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: integer division
LL | let n = 1 / 2; LL | let n = 1 / 2;
| ^^^^^ | ^^^^^
| |
= note: `-D clippy::integer-division` implied by `-D warnings`
= help: division of integers may cause loss of precision. consider using floats = help: division of integers may cause loss of precision. consider using floats
= note: `-D clippy::integer-division` implied by `-D warnings`
error: integer division error: integer division
--> $DIR/integer_division.rs:6:13 --> $DIR/integer_division.rs:6:13

View File

@ -18,8 +18,8 @@ error: methods called `new` usually take no `self`
LL | pub async fn new(&mut self) -> Self { LL | pub async fn new(&mut self) -> Self {
| ^^^^^^^^^ | ^^^^^^^^^
| |
= note: `-D clippy::wrong-self-convention` implied by `-D warnings`
= help: consider choosing a less ambiguous name = help: consider choosing a less ambiguous name
= note: `-D clippy::wrong-self-convention` implied by `-D warnings`
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -4,8 +4,8 @@ error: called `.iter().nth()` on a Vec
LL | let bad_vec = some_vec.iter().nth(3); LL | let bad_vec = some_vec.iter().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::iter-nth` implied by `-D warnings`
= help: calling `.get()` is both faster and more readable = help: calling `.get()` is both faster and more readable
= note: `-D clippy::iter-nth` implied by `-D warnings`
error: called `.iter().nth()` on a slice error: called `.iter().nth()` on a slice
--> $DIR/iter_nth.rs:34:26 --> $DIR/iter_nth.rs:34:26

View File

@ -4,12 +4,12 @@ error: called `skip(..).next()` on an iterator
LL | let _: Vec<&str> = sp.skip(1).next().unwrap().split(' ').collect(); LL | let _: Vec<&str> = sp.skip(1).next().unwrap().split(' ').collect();
| ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)` | ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)`
| |
= note: `-D clippy::iter-skip-next` implied by `-D warnings`
help: for this change `sp` has to be mutable help: for this change `sp` has to be mutable
--> $DIR/iter_skip_next_unfixable.rs:8:9 --> $DIR/iter_skip_next_unfixable.rs:8:9
| |
LL | let sp = test_string.split('|').map(|s| s.trim()); LL | let sp = test_string.split('|').map(|s| s.trim());
| ^^ | ^^
= note: `-D clippy::iter-skip-next` implied by `-D warnings`
error: called `skip(..).next()` on an iterator error: called `skip(..).next()` on an iterator
--> $DIR/iter_skip_next_unfixable.rs:11:29 --> $DIR/iter_skip_next_unfixable.rs:11:29

View File

@ -4,8 +4,8 @@ error: allocating a local array larger than 512000 bytes
LL | [0u32; 20_000_000], LL | [0u32; 20_000_000],
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::large-stack-arrays` implied by `-D warnings`
= help: consider allocating on the heap with `vec![0u32; 20_000_000].into_boxed_slice()` = help: consider allocating on the heap with `vec![0u32; 20_000_000].into_boxed_slice()`
= note: `-D clippy::large-stack-arrays` implied by `-D warnings`
error: allocating a local array larger than 512000 bytes error: allocating a local array larger than 512000 bytes
--> $DIR/large_stack_arrays.rs:24:9 --> $DIR/large_stack_arrays.rs:24:9

View File

@ -92,8 +92,8 @@ error: this returns a `Result<_, ()>`
LL | pub fn len(&self) -> Result<usize, ()> { LL | pub fn len(&self) -> Result<usize, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::result-unit-err` implied by `-D warnings`
= help: use a custom `Error` type instead = help: use a custom `Error` type instead
= note: `-D clippy::result-unit-err` implied by `-D warnings`
error: this returns a `Result<_, ()>` error: this returns a `Result<_, ()>`
--> $DIR/len_without_is_empty.rs:240:5 --> $DIR/len_without_is_empty.rs:240:5

View File

@ -7,8 +7,8 @@ LL | | foo = 42;
LL | | } LL | | }
| |_____^ help: it is more idiomatic to write: `let <mut> foo = if f() { 42 } else { 0 };` | |_____^ help: it is more idiomatic to write: `let <mut> foo = if f() { 42 } else { 0 };`
| |
= note: `-D clippy::useless-let-if-seq` implied by `-D warnings`
= note: you might not need `mut` at all = note: you might not need `mut` at all
= note: `-D clippy::useless-let-if-seq` implied by `-D warnings`
error: `if _ { .. } else { .. }` is an expression error: `if _ { .. } else { .. }` is an expression
--> $DIR/let_if_seq.rs:71:5 --> $DIR/let_if_seq.rs:71:5

View File

@ -4,8 +4,8 @@ error: non-binding `let` on a type that implements `Drop`
LL | let _ = Box::new(()); LL | let _ = Box::new(());
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::let-underscore-drop` implied by `-D warnings`
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
= note: `-D clippy::let-underscore-drop` implied by `-D warnings`
error: non-binding `let` on a type that implements `Drop` error: non-binding `let` on a type that implements `Drop`
--> $DIR/let_underscore_drop.rs:18:5 --> $DIR/let_underscore_drop.rs:18:5

View File

@ -4,8 +4,8 @@ error: non-binding let on a synchronization lock
LL | let _ = m.lock(); LL | let _ = m.lock();
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::let-underscore-lock` implied by `-D warnings`
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
= note: `-D clippy::let-underscore-lock` implied by `-D warnings`
error: non-binding let on a synchronization lock error: non-binding let on a synchronization lock
--> $DIR/let_underscore_lock.rs:10:5 --> $DIR/let_underscore_lock.rs:10:5

View File

@ -4,8 +4,8 @@ error: non-binding let on a result of a `#[must_use]` function
LL | let _ = f(); LL | let _ = f();
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: `-D clippy::let-underscore-must-use` implied by `-D warnings`
= help: consider explicitly using function result = help: consider explicitly using function result
= note: `-D clippy::let-underscore-must-use` implied by `-D warnings`
error: non-binding let on an expression with `#[must_use]` type error: non-binding let on an expression with `#[must_use]` type
--> $DIR/let_underscore_must_use.rs:68:5 --> $DIR/let_underscore_must_use.rs:68:5

View File

@ -4,8 +4,8 @@ error: you seem to be using a `LinkedList`! Perhaps you meant some other data st
LL | const C: LinkedList<i32> = LinkedList::new(); LL | const C: LinkedList<i32> = LinkedList::new();
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
= note: `-D clippy::linkedlist` implied by `-D warnings`
= help: a `VecDeque` might work = help: a `VecDeque` might work
= note: `-D clippy::linkedlist` implied by `-D warnings`
error: you seem to be using a `LinkedList`! Perhaps you meant some other data structure? error: you seem to be using a `LinkedList`! Perhaps you meant some other data structure?
--> $DIR/linkedlist.rs:9:11 --> $DIR/linkedlist.rs:9:11

View File

@ -9,8 +9,8 @@ LL | | }
LL | | None LL | | None
| |________^ help: replace with an iterator: `strings.into_iter().find(|s| s == String::new())` | |________^ help: replace with an iterator: `strings.into_iter().find(|s| s == String::new())`
| |
= note: `-D clippy::manual-find` implied by `-D warnings`
= note: you may need to dereference some variables = note: you may need to dereference some variables
= note: `-D clippy::manual-find` implied by `-D warnings`
error: manual implementation of `Iterator::find` error: manual implementation of `Iterator::find`
--> $DIR/manual_find.rs:14:5 --> $DIR/manual_find.rs:14:5

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