Skip to content

Commit

Permalink
bless clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Oct 1, 2022
1 parent 0867c64 commit 8dfbad9
Show file tree
Hide file tree
Showing 205 changed files with 231 additions and 231 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: `std::string::String` may not be held across an `await` point per `clippy
LL | let _x = String::from("hello");
| ^^
|
= note: `-D clippy::await-holding-invalid-type` implied by `-D warnings`
= 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`
--> $DIR/await_holding_invalid_type.rs:10:9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ error: the function has a cognitive complexity of (3/2)
LL | fn cognitive_complexity() {
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= 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

2 changes: 1 addition & 1 deletion tests/ui-toml/expect_used/expect_used.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: used `expect()` on `an Option` value
LL | let _ = opt.expect("");
| ^^^^^^^^^^^^^^
|
= note: `-D clippy::expect-used` implied by `-D warnings`
= 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
--> $DIR/expect_used.rs:11:13
Expand Down
2 changes: 1 addition & 1 deletion tests/ui-toml/fn_params_excessive_bools/test.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: more than 1 bools in function parameters
LL | fn g(_: bool, _: bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
= 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

2 changes: 1 addition & 1 deletion tests/ui-toml/large_include_file/large_include_file.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: attempted to include a large file
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: `-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)

error: attempted to include a large file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ error: use of irregular braces for `vec!` macro
LL | let _ = vec! {1, 2, 3};
| ^^^^^^^^^^^^^^
|
= note: `-D clippy::nonstandard-macro-braces` implied by `-D warnings`
help: consider writing `vec![1, 2, 3]`
--> $DIR/conf_nonstandard_macro_braces.rs:43:13
|
LL | let _ = vec! {1, 2, 3};
| ^^^^^^^^^^^^^^
= note: `-D clippy::nonstandard-macro-braces` implied by `-D warnings`

error: use of irregular braces for `format!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:44:13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ error: some fields in `NoGeneric` are not safe to be sent to another thread
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
--> $DIR/test.rs:8:5
|
LL | rc_is_not_send: Rc<String>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= 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
--> $DIR/test.rs:19:1
Expand Down
2 changes: 1 addition & 1 deletion tests/ui-toml/struct_excessive_bools/test.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ LL | | a: bool,
LL | | }
| |_^
|
= note: `-D clippy::struct-excessive-bools` implied by `-D warnings`
= 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

2 changes: 1 addition & 1 deletion tests/ui-toml/unwrap_used/unwrap_used.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ error: used `unwrap()` on `an Option` value
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
= note: `-D clippy::unwrap-used` implied by `-D warnings`

error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:36:17
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/absurd-extreme-comparisons.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: this comparison involving the minimum or maximum element for this type co
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
= 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
--> $DIR/absurd-extreme-comparisons.rs:15:5
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/allow_attributes_without_reason.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ error: `allow` attribute without specifying a reason
LL | #[allow(dead_code)]
| ^^^^^^^^^^^^^^^^^^^
|
= help: try adding a reason at the end with `, reason = ".."`
note: the lint level is defined here
--> $DIR/allow_attributes_without_reason.rs:2:9
|
LL | #![deny(clippy::allow_attributes_without_reason)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: try adding a reason at the end with `, reason = ".."`

error: `allow` attribute without specifying a reason
--> $DIR/allow_attributes_without_reason.rs:6:1
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/approx_const.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: approximate value of `f{32, 64}::consts::E` found
LL | let my_e = 2.7182;
| ^^^^^^
|
= note: `-D clippy::approx-constant` implied by `-D warnings`
= 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
--> $DIR/approx_const.rs:5:20
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/as_conversions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: using a potentially dangerous silent `as` conversion
LL | let i = 0u32 as u64;
| ^^^^^^^^^^^
|
= note: `-D clippy::as-conversions` implied by `-D warnings`
= 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
--> $DIR/as_conversions.rs:17:13
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/asm_syntax.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: Intel x86 assembly syntax used
LL | asm!("");
| ^^^^^^^^
|
= note: `-D clippy::inline-asm-x86-intel-syntax` implied by `-D warnings`
= 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
--> $DIR/asm_syntax.rs:9:9
Expand All @@ -29,8 +29,8 @@ error: AT&T x86 assembly syntax used
LL | asm!("", options(att_syntax));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::inline-asm-x86-att-syntax` implied by `-D warnings`
= 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
--> $DIR/asm_syntax.rs:24:9
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/assertions_on_constants.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: `assert!(true)` will be optimized out by the compiler
LL | assert!(true);
| ^^^^^^^^^^^^^
|
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
= help: remove it
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`

error: `assert!(false)` should probably be replaced
--> $DIR/assertions_on_constants.rs:11:5
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/await_holding_lock.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error: this `MutexGuard` is held across an `await` point
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
note: these are all the `await` points this lock is held through
--> $DIR/await_holding_lock.rs:9:9
Expand All @@ -13,6 +12,7 @@ LL | / let guard = x.lock().unwrap();
LL | | baz().await
LL | | }
| |_____^
= note: `-D clippy::await-holding-lock` implied by `-D warnings`

error: this `MutexGuard` is held across an `await` point
--> $DIR/await_holding_lock.rs:24:13
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/await_holding_refcell_ref.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error: this `RefCell` reference is held across an `await` point
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`
note: these are all the `await` points this reference is held through
--> $DIR/await_holding_refcell_ref.rs:6:5
Expand All @@ -13,6 +12,7 @@ LL | / let b = x.borrow();
LL | | baz().await
LL | | }
| |_^
= note: `-D clippy::await-holding-refcell-ref` implied by `-D warnings`

error: this `RefCell` reference is held across an `await` point
--> $DIR/await_holding_refcell_ref.rs:11:9
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/blanket_clippy_restriction_lints.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: restriction lints are not meant to be all enabled
LL | #![warn(clippy::restriction)]
| ^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
= 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
--> $DIR/blanket_clippy_restriction_lints.rs:5:9
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/bool_to_int_with_if.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ LL | | 0
LL | | };
| |_____^ 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: `-D clippy::bool-to-int-with-if` implied by `-D warnings`

error: boolean to int conversion using if
--> $DIR/bool_to_int_with_if.rs:20:5
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/borrow_interior_mutable_const/enums.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
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
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`

error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:37:18
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/borrow_interior_mutable_const/others.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
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
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`

error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:55:16
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/borrow_interior_mutable_const/traits.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
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
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`

error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:26:18
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/box_collection.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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>>) {}
| ^^^^^^^^^^^^^^
|
= note: `-D clippy::box-collection` implied by `-D warnings`
= 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`
--> $DIR/box_collection.rs:28:15
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/branches_sharing_code/shared_at_bottom.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ LL | | result
LL | | };
| |_____^
|
= note: the end suggestion probably needs some adjustments to use the expression result correctly
note: the lint level is defined here
--> $DIR/shared_at_bottom.rs:2:36
|
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
|
LL ~ }
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/branches_sharing_code/shared_at_top.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ LL | | println!("This should trigger `IS_SAME_THAN_ELSE` as usual");
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
--> $DIR/shared_at_top.rs:98:12
|
Expand All @@ -116,6 +111,11 @@ LL | } else {
LL | | println!("This should trigger `IS_SAME_THAN_ELSE` as usual");
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

10 changes: 5 additions & 5 deletions tests/ui/branches_sharing_code/shared_at_top_and_bottom.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ LL | | let _overlap_start = t * 2;
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
--> $DIR/shared_at_top_and_bottom.rs:28:5
|
LL | / let _u = 9;
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
|
LL ~ let t = 7;
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/branches_sharing_code/valid_if_blocks.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ LL | if false {
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
--> $DIR/valid_if_blocks.rs:105:12
|
LL | } else {
| ____________^
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
--> $DIR/valid_if_blocks.rs:115:15
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/case_sensitive_file_extension_comparisons.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: case-sensitive file extension comparison
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
= note: `-D clippy::case-sensitive-file-extension-comparisons` implied by `-D warnings`

error: case-sensitive file extension comparison
--> $DIR/case_sensitive_file_extension_comparisons.rs:17:27
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/char_lit_as_u8.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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.
| ^^^^^^^^^
|
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
= 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

2 changes: 1 addition & 1 deletion tests/ui/char_lit_as_u8_suggestions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: casting a character literal to `u8` truncates
LL | let _ = 'a' as u8;
| ^^^^^^^^^ 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: `-D clippy::char-lit-as-u8` implied by `-D warnings`

error: casting a character literal to `u8` truncates
--> $DIR/char_lit_as_u8_suggestions.rs:7:13
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/checked_unwrap/complex_conditionals.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ LL | if x.is_ok() && y.is_err() {
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
|
= help: try using `if let` or `match`
note: the lint level is defined here
--> $DIR/complex_conditionals.rs:1:35
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: try using `if let` or `match`

error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:9:9
Expand Down
Loading

0 comments on commit 8dfbad9

Please sign in to comment.