Skip to content

Commit 9d388dc

Browse files
committed
bless clippy
1 parent 13b67fb commit 9d388dc

File tree

205 files changed

+231
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+231
-231
lines changed

src/tools/clippy/tests/ui-toml/await_holding_invalid_type/await_holding_invalid_type.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: `std::string::String` may not be held across an `await` point per `clippy
44
LL | let _x = String::from("hello");
55
| ^^
66
|
7-
= note: `-D clippy::await-holding-invalid-type` implied by `-D warnings`
87
= note: strings are bad
8+
= note: `-D clippy::await-holding-invalid-type` implied by `-D warnings`
99

1010
error: `std::net::Ipv4Addr` may not be held across an `await` point per `clippy.toml`
1111
--> $DIR/await_holding_invalid_type.rs:10:9

src/tools/clippy/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ error: the function has a cognitive complexity of (3/2)
88
LL | fn cognitive_complexity() {
99
| ^^^^^^^^^^^^^^^^^^^^
1010
|
11-
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
1211
= help: you could split it up into multiple smaller functions
12+
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
1313

1414
error: aborting due to previous error; 2 warnings emitted
1515

src/tools/clippy/tests/ui-toml/expect_used/expect_used.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: used `expect()` on `an Option` value
44
LL | let _ = opt.expect("");
55
| ^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::expect-used` implied by `-D warnings`
87
= help: if this value is `None`, it will panic
8+
= note: `-D clippy::expect-used` implied by `-D warnings`
99

1010
error: used `expect()` on `a Result` value
1111
--> $DIR/expect_used.rs:11:13

src/tools/clippy/tests/ui-toml/fn_params_excessive_bools/test.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: more than 1 bools in function parameters
44
LL | fn g(_: bool, _: bool) {}
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
87
= help: consider refactoring bools into two-variant enums
8+
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
99

1010
error: aborting due to previous error
1111

src/tools/clippy/tests/ui-toml/large_include_file/large_include_file.stderr

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

1111
error: attempted to include a large file

src/tools/clippy/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ error: use of irregular braces for `vec!` macro
44
LL | let _ = vec! {1, 2, 3};
55
| ^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::nonstandard-macro-braces` implied by `-D warnings`
87
help: consider writing `vec![1, 2, 3]`
98
--> $DIR/conf_nonstandard_macro_braces.rs:43:13
109
|
1110
LL | let _ = vec! {1, 2, 3};
1211
| ^^^^^^^^^^^^^^
12+
= note: `-D clippy::nonstandard-macro-braces` implied by `-D warnings`
1313

1414
error: use of irregular braces for `format!` macro
1515
--> $DIR/conf_nonstandard_macro_braces.rs:44:13

src/tools/clippy/tests/ui-toml/strict_non_send_fields_in_send_ty/test.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ error: some fields in `NoGeneric` are not safe to be sent to another thread
44
LL | unsafe impl Send for NoGeneric {}
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::non-send-fields-in-send-ty` implied by `-D warnings`
87
note: it is not safe to send field `rc_is_not_send` to another thread
98
--> $DIR/test.rs:8:5
109
|
1110
LL | rc_is_not_send: Rc<String>,
1211
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
1312
= help: use a thread-safe type that implements `Send`
13+
= note: `-D clippy::non-send-fields-in-send-ty` implied by `-D warnings`
1414

1515
error: some fields in `MultiField<T>` are not safe to be sent to another thread
1616
--> $DIR/test.rs:19:1

src/tools/clippy/tests/ui-toml/struct_excessive_bools/test.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ LL | | a: bool,
66
LL | | }
77
| |_^
88
|
9-
= note: `-D clippy::struct-excessive-bools` implied by `-D warnings`
109
= help: consider using a state machine or refactoring bools into two-variant enums
10+
= note: `-D clippy::struct-excessive-bools` implied by `-D warnings`
1111

1212
error: aborting due to previous error
1313

src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ error: used `unwrap()` on `an Option` value
1616
LL | let _ = boxed_slice.get(1).unwrap();
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818
|
19-
= note: `-D clippy::unwrap-used` implied by `-D warnings`
2019
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
20+
= note: `-D clippy::unwrap-used` implied by `-D warnings`
2121

2222
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
2323
--> $DIR/unwrap_used.rs:36:17

src/tools/clippy/tests/ui/absurd-extreme-comparisons.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: this comparison involving the minimum or maximum element for this type co
44
LL | u <= 0;
55
| ^^^^^^
66
|
7-
= note: `-D clippy::absurd-extreme-comparisons` implied by `-D warnings`
87
= 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
8+
= note: `-D clippy::absurd-extreme-comparisons` implied by `-D warnings`
99

1010
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
1111
--> $DIR/absurd-extreme-comparisons.rs:15:5

src/tools/clippy/tests/ui/allow_attributes_without_reason.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ error: `allow` attribute without specifying a reason
44
LL | #[allow(dead_code)]
55
| ^^^^^^^^^^^^^^^^^^^
66
|
7+
= help: try adding a reason at the end with `, reason = ".."`
78
note: the lint level is defined here
89
--> $DIR/allow_attributes_without_reason.rs:2:9
910
|
1011
LL | #![deny(clippy::allow_attributes_without_reason)]
1112
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
= help: try adding a reason at the end with `, reason = ".."`
1313

1414
error: `allow` attribute without specifying a reason
1515
--> $DIR/allow_attributes_without_reason.rs:6:1

src/tools/clippy/tests/ui/approx_const.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: approximate value of `f{32, 64}::consts::E` found
44
LL | let my_e = 2.7182;
55
| ^^^^^^
66
|
7-
= note: `-D clippy::approx-constant` implied by `-D warnings`
87
= help: consider using the constant directly
8+
= note: `-D clippy::approx-constant` implied by `-D warnings`
99

1010
error: approximate value of `f{32, 64}::consts::E` found
1111
--> $DIR/approx_const.rs:5:20

src/tools/clippy/tests/ui/as_conversions.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: using a potentially dangerous silent `as` conversion
44
LL | let i = 0u32 as u64;
55
| ^^^^^^^^^^^
66
|
7-
= note: `-D clippy::as-conversions` implied by `-D warnings`
87
= help: consider using a safe wrapper for this conversion
8+
= note: `-D clippy::as-conversions` implied by `-D warnings`
99

1010
error: using a potentially dangerous silent `as` conversion
1111
--> $DIR/as_conversions.rs:17:13

src/tools/clippy/tests/ui/asm_syntax.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: Intel x86 assembly syntax used
44
LL | asm!("");
55
| ^^^^^^^^
66
|
7-
= note: `-D clippy::inline-asm-x86-intel-syntax` implied by `-D warnings`
87
= help: use AT&T x86 assembly syntax
8+
= note: `-D clippy::inline-asm-x86-intel-syntax` implied by `-D warnings`
99

1010
error: Intel x86 assembly syntax used
1111
--> $DIR/asm_syntax.rs:9:9
@@ -29,8 +29,8 @@ error: AT&T x86 assembly syntax used
2929
LL | asm!("", options(att_syntax));
3030
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3131
|
32-
= note: `-D clippy::inline-asm-x86-att-syntax` implied by `-D warnings`
3332
= help: use Intel x86 assembly syntax
33+
= note: `-D clippy::inline-asm-x86-att-syntax` implied by `-D warnings`
3434

3535
error: AT&T x86 assembly syntax used
3636
--> $DIR/asm_syntax.rs:24:9

src/tools/clippy/tests/ui/assertions_on_constants.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: `assert!(true)` will be optimized out by the compiler
44
LL | assert!(true);
55
| ^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
87
= help: remove it
8+
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
99

1010
error: `assert!(false)` should probably be replaced
1111
--> $DIR/assertions_on_constants.rs:11:5

src/tools/clippy/tests/ui/await_holding_lock.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ error: this `MutexGuard` is held across an `await` point
44
LL | let guard = x.lock().unwrap();
55
| ^^^^^
66
|
7-
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
87
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
98
note: these are all the `await` points this lock is held through
109
--> $DIR/await_holding_lock.rs:9:9
@@ -13,6 +12,7 @@ LL | / let guard = x.lock().unwrap();
1312
LL | | baz().await
1413
LL | | }
1514
| |_____^
15+
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
1616

1717
error: this `MutexGuard` is held across an `await` point
1818
--> $DIR/await_holding_lock.rs:24:13

src/tools/clippy/tests/ui/await_holding_refcell_ref.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ error: this `RefCell` reference is held across an `await` point
44
LL | let b = x.borrow();
55
| ^
66
|
7-
= note: `-D clippy::await-holding-refcell-ref` implied by `-D warnings`
87
= help: ensure the reference is dropped before calling `await`
98
note: these are all the `await` points this reference is held through
109
--> $DIR/await_holding_refcell_ref.rs:6:5
@@ -13,6 +12,7 @@ LL | / let b = x.borrow();
1312
LL | | baz().await
1413
LL | | }
1514
| |_^
15+
= note: `-D clippy::await-holding-refcell-ref` implied by `-D warnings`
1616

1717
error: this `RefCell` reference is held across an `await` point
1818
--> $DIR/await_holding_refcell_ref.rs:11:9

src/tools/clippy/tests/ui/blanket_clippy_restriction_lints.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: restriction lints are not meant to be all enabled
44
LL | #![warn(clippy::restriction)]
55
| ^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
87
= help: try enabling only the lints you really need
8+
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
99

1010
error: restriction lints are not meant to be all enabled
1111
--> $DIR/blanket_clippy_restriction_lints.rs:5:9

src/tools/clippy/tests/ui/bool_to_int_with_if.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ LL | | 0
88
LL | | };
99
| |_____^ help: replace with from: `i32::from(a)`
1010
|
11-
= note: `-D clippy::bool-to-int-with-if` implied by `-D warnings`
1211
= note: `a as i32` or `a.into()` can also be valid options
12+
= note: `-D clippy::bool-to-int-with-if` implied by `-D warnings`
1313

1414
error: boolean to int conversion using if
1515
--> $DIR/bool_to_int_with_if.rs:20:5

src/tools/clippy/tests/ui/borrow_interior_mutable_const/enums.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
44
LL | let _ = &UNFROZEN_VARIANT; //~ ERROR interior mutability
55
| ^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
87
= help: assign this const to a local or static variable, and use the variable here
8+
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
99

1010
error: a `const` item with interior mutability should not be borrowed
1111
--> $DIR/enums.rs:37:18

src/tools/clippy/tests/ui/borrow_interior_mutable_const/others.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
44
LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
55
| ^^^^^^
66
|
7-
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
87
= help: assign this const to a local or static variable, and use the variable here
8+
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
99

1010
error: a `const` item with interior mutability should not be borrowed
1111
--> $DIR/others.rs:55:16

src/tools/clippy/tests/ui/borrow_interior_mutable_const/traits.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
44
LL | let _ = &Self::ATOMIC; //~ ERROR interior mutable
55
| ^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
87
= help: assign this const to a local or static variable, and use the variable here
8+
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
99

1010
error: a `const` item with interior mutability should not be borrowed
1111
--> $DIR/traits.rs:26:18

src/tools/clippy/tests/ui/box_collection.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: you seem to be trying to use `Box<Vec<..>>`. Consider using just `Vec<..>
44
LL | fn test1(foo: Box<Vec<bool>>) {}
55
| ^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::box-collection` implied by `-D warnings`
87
= help: `Vec<..>` is already on the heap, `Box<Vec<..>>` makes an extra allocation
8+
= note: `-D clippy::box-collection` implied by `-D warnings`
99

1010
error: you seem to be trying to use `Box<String>`. Consider using just `String`
1111
--> $DIR/box_collection.rs:28:15

src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ LL | | result
77
LL | | };
88
| |_____^
99
|
10+
= note: the end suggestion probably needs some adjustments to use the expression result correctly
1011
note: the lint level is defined here
1112
--> $DIR/shared_at_bottom.rs:2:36
1213
|
1314
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
1415
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15-
= note: the end suggestion probably needs some adjustments to use the expression result correctly
1616
help: consider moving these statements after the if
1717
|
1818
LL ~ }

src/tools/clippy/tests/ui/branches_sharing_code/shared_at_top.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ LL | | println!("This should trigger `IS_SAME_THAN_ELSE` as usual");
103103
LL | | } else {
104104
| |_____^
105105
|
106-
note: the lint level is defined here
107-
--> $DIR/shared_at_top.rs:2:9
108-
|
109-
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
110-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
111106
note: same as this
112107
--> $DIR/shared_at_top.rs:98:12
113108
|
@@ -116,6 +111,11 @@ LL | } else {
116111
LL | | println!("This should trigger `IS_SAME_THAN_ELSE` as usual");
117112
LL | | }
118113
| |_____^
114+
note: the lint level is defined here
115+
--> $DIR/shared_at_top.rs:2:9
116+
|
117+
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
118+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
119119

120120
error: aborting due to 7 previous errors
121121

src/tools/clippy/tests/ui/branches_sharing_code/shared_at_top_and_bottom.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ LL | | let _overlap_start = t * 2;
77
LL | | let _overlap_end = 2 * t;
88
| |_________________________________^
99
|
10-
note: the lint level is defined here
11-
--> $DIR/shared_at_top_and_bottom.rs:2:36
12-
|
13-
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1510
note: this code is shared at the end
1611
--> $DIR/shared_at_top_and_bottom.rs:28:5
1712
|
1813
LL | / let _u = 9;
1914
LL | | }
2015
| |_____^
16+
note: the lint level is defined here
17+
--> $DIR/shared_at_top_and_bottom.rs:2:36
18+
|
19+
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
20+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2121
help: consider moving these statements before the if
2222
|
2323
LL ~ let t = 7;

src/tools/clippy/tests/ui/branches_sharing_code/valid_if_blocks.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ LL | if false {
66
LL | | } else {
77
| |_____^
88
|
9-
note: the lint level is defined here
10-
--> $DIR/valid_if_blocks.rs:2:9
11-
|
12-
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
13-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
149
note: same as this
1510
--> $DIR/valid_if_blocks.rs:105:12
1611
|
1712
LL | } else {
1813
| ____________^
1914
LL | | }
2015
| |_____^
16+
note: the lint level is defined here
17+
--> $DIR/valid_if_blocks.rs:2:9
18+
|
19+
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
20+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
2121

2222
error: this `if` has identical blocks
2323
--> $DIR/valid_if_blocks.rs:115:15

src/tools/clippy/tests/ui/case_sensitive_file_extension_comparisons.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: case-sensitive file extension comparison
44
LL | filename.ends_with(".rs")
55
| ^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::case-sensitive-file-extension-comparisons` implied by `-D warnings`
87
= help: consider using a case-insensitive comparison instead
8+
= note: `-D clippy::case-sensitive-file-extension-comparisons` implied by `-D warnings`
99

1010
error: case-sensitive file extension comparison
1111
--> $DIR/case_sensitive_file_extension_comparisons.rs:17:27

src/tools/clippy/tests/ui/char_lit_as_u8.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: casting a character literal to `u8` truncates
44
LL | let _ = '❤' as u8; // no suggestion, since a byte literal won't work.
55
| ^^^^^^^^^
66
|
7-
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
87
= note: `char` is four bytes wide, but `u8` is a single byte
8+
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
99

1010
error: aborting due to previous error
1111

src/tools/clippy/tests/ui/char_lit_as_u8_suggestions.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: casting a character literal to `u8` truncates
44
LL | let _ = 'a' as u8;
55
| ^^^^^^^^^ help: use a byte literal instead: `b'a'`
66
|
7-
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
87
= note: `char` is four bytes wide, but `u8` is a single byte
8+
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
99

1010
error: casting a character literal to `u8` truncates
1111
--> $DIR/char_lit_as_u8_suggestions.rs:7:13

src/tools/clippy/tests/ui/checked_unwrap/complex_conditionals.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ LL | if x.is_ok() && y.is_err() {
66
LL | x.unwrap(); // unnecessary
77
| ^^^^^^^^^^
88
|
9+
= help: try using `if let` or `match`
910
note: the lint level is defined here
1011
--> $DIR/complex_conditionals.rs:1:35
1112
|
1213
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
1314
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
14-
= help: try using `if let` or `match`
1515

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

0 commit comments

Comments
 (0)