Skip to content

Commit 93f5530

Browse files
committed
Remove #[allow(unused_tuple_struct_fields)] from Clippy tests
1 parent 53eca9f commit 93f5530

18 files changed

+59
-70
lines changed

src/tools/clippy/tests/ui/borrow_interior_mutable_const/auxiliary/helper.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// As the most common case is the `http` crate, it replicates `http::HeaderName`'s structure.
33

44
#![allow(clippy::declare_interior_mutable_const)]
5-
#![allow(unused_tuple_struct_fields)]
65

76
use std::sync::atomic::AtomicUsize;
87

src/tools/clippy/tests/ui/format.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![warn(clippy::useless_format)]
22
#![allow(
3-
unused_tuple_struct_fields,
43
clippy::print_literal,
54
clippy::redundant_clone,
65
clippy::to_string_in_format_args,

src/tools/clippy/tests/ui/format.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![warn(clippy::useless_format)]
22
#![allow(
3-
unused_tuple_struct_fields,
43
clippy::print_literal,
54
clippy::redundant_clone,
65
clippy::to_string_in_format_args,

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

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: useless use of `format!`
2-
--> $DIR/format.rs:20:5
2+
--> $DIR/format.rs:19:5
33
|
44
LL | format!("foo");
55
| ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
@@ -8,19 +8,19 @@ LL | format!("foo");
88
= help: to override `-D warnings` add `#[allow(clippy::useless_format)]`
99

1010
error: useless use of `format!`
11-
--> $DIR/format.rs:21:5
11+
--> $DIR/format.rs:20:5
1212
|
1313
LL | format!("{{}}");
1414
| ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{}".to_string()`
1515

1616
error: useless use of `format!`
17-
--> $DIR/format.rs:22:5
17+
--> $DIR/format.rs:21:5
1818
|
1919
LL | format!("{{}} abc {{}}");
2020
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{} abc {}".to_string()`
2121

2222
error: useless use of `format!`
23-
--> $DIR/format.rs:23:5
23+
--> $DIR/format.rs:22:5
2424
|
2525
LL | / format!(
2626
LL | | r##"foo {{}}
@@ -35,67 +35,67 @@ LL ~ " bar"##.to_string();
3535
|
3636

3737
error: useless use of `format!`
38-
--> $DIR/format.rs:28:13
38+
--> $DIR/format.rs:27:13
3939
|
4040
LL | let _ = format!("");
4141
| ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()`
4242

4343
error: useless use of `format!`
44-
--> $DIR/format.rs:30:5
44+
--> $DIR/format.rs:29:5
4545
|
4646
LL | format!("{}", "foo");
4747
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
4848

4949
error: useless use of `format!`
50-
--> $DIR/format.rs:38:5
50+
--> $DIR/format.rs:37:5
5151
|
5252
LL | format!("{}", arg);
5353
| ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
5454

5555
error: useless use of `format!`
56-
--> $DIR/format.rs:68:5
56+
--> $DIR/format.rs:67:5
5757
|
5858
LL | format!("{}", 42.to_string());
5959
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `42.to_string()`
6060

6161
error: useless use of `format!`
62-
--> $DIR/format.rs:70:5
62+
--> $DIR/format.rs:69:5
6363
|
6464
LL | format!("{}", x.display().to_string());
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.display().to_string()`
6666

6767
error: useless use of `format!`
68-
--> $DIR/format.rs:74:18
68+
--> $DIR/format.rs:73:18
6969
|
7070
LL | let _ = Some(format!("{}", a + "bar"));
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `a + "bar"`
7272

7373
error: useless use of `format!`
74-
--> $DIR/format.rs:78:22
74+
--> $DIR/format.rs:77:22
7575
|
7676
LL | let _s: String = format!("{}", &*v.join("\n"));
7777
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&*v.join("\n")).to_string()`
7878

7979
error: useless use of `format!`
80-
--> $DIR/format.rs:84:13
80+
--> $DIR/format.rs:83:13
8181
|
8282
LL | let _ = format!("{x}");
8383
| ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
8484

8585
error: useless use of `format!`
86-
--> $DIR/format.rs:86:13
86+
--> $DIR/format.rs:85:13
8787
|
8888
LL | let _ = format!("{y}", y = x);
8989
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
9090

9191
error: useless use of `format!`
92-
--> $DIR/format.rs:90:13
92+
--> $DIR/format.rs:89:13
9393
|
9494
LL | let _ = format!("{abc}");
9595
| ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `abc.to_string()`
9696

9797
error: useless use of `format!`
98-
--> $DIR/format.rs:92:13
98+
--> $DIR/format.rs:91:13
9999
|
100100
LL | let _ = format!("{xx}");
101101
| ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `xx.to_string()`

src/tools/clippy/tests/ui/from_iter_instead_of_collect.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::from_iter_instead_of_collect)]
2-
#![allow(unused_imports, unused_tuple_struct_fields)]
2+
#![allow(unused_imports)]
33
#![allow(clippy::useless_vec)]
44

55
use std::collections::{BTreeMap, BTreeSet, HashMap, VecDeque};

src/tools/clippy/tests/ui/from_iter_instead_of_collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::from_iter_instead_of_collect)]
2-
#![allow(unused_imports, unused_tuple_struct_fields)]
2+
#![allow(unused_imports)]
33
#![allow(clippy::useless_vec)]
44

55
use std::collections::{BTreeMap, BTreeSet, HashMap, VecDeque};

src/tools/clippy/tests/ui/must_use_candidates.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![feature(never_type)]
22
#![allow(
33
unused_mut,
4-
unused_tuple_struct_fields,
54
clippy::redundant_allocation,
65
clippy::needless_pass_by_ref_mut
76
)]

src/tools/clippy/tests/ui/must_use_candidates.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![feature(never_type)]
22
#![allow(
33
unused_mut,
4-
unused_tuple_struct_fields,
54
clippy::redundant_allocation,
65
clippy::needless_pass_by_ref_mut
76
)]

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this function could have a `#[must_use]` attribute
2-
--> $DIR/must_use_candidates.rs:16:1
2+
--> $DIR/must_use_candidates.rs:15:1
33
|
44
LL | pub fn pure(i: u8) -> u8 {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn pure(i: u8) -> u8`
@@ -8,25 +8,25 @@ LL | pub fn pure(i: u8) -> u8 {
88
= help: to override `-D warnings` add `#[allow(clippy::must_use_candidate)]`
99

1010
error: this method could have a `#[must_use]` attribute
11-
--> $DIR/must_use_candidates.rs:21:5
11+
--> $DIR/must_use_candidates.rs:20:5
1212
|
1313
LL | pub fn inherent_pure(&self) -> u8 {
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn inherent_pure(&self) -> u8`
1515

1616
error: this function could have a `#[must_use]` attribute
17-
--> $DIR/must_use_candidates.rs:52:1
17+
--> $DIR/must_use_candidates.rs:51:1
1818
|
1919
LL | pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool {
2020
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool`
2121

2222
error: this function could have a `#[must_use]` attribute
23-
--> $DIR/must_use_candidates.rs:64:1
23+
--> $DIR/must_use_candidates.rs:63:1
2424
|
2525
LL | pub fn rcd(_x: Rc<u32>) -> bool {
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn rcd(_x: Rc<u32>) -> bool`
2727

2828
error: this function could have a `#[must_use]` attribute
29-
--> $DIR/must_use_candidates.rs:72:1
29+
--> $DIR/must_use_candidates.rs:71:1
3030
|
3131
LL | pub fn arcd(_x: Arc<u32>) -> bool {
3232
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn arcd(_x: Arc<u32>) -> bool`

src/tools/clippy/tests/ui/numbered_fields.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::init_numbered_fields)]
2-
#![allow(unused_tuple_struct_fields)]
32

43
#[derive(Default)]
54
struct TupleStruct(u32, u32, u8);

src/tools/clippy/tests/ui/numbered_fields.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::init_numbered_fields)]
2-
#![allow(unused_tuple_struct_fields)]
32

43
#[derive(Default)]
54
struct TupleStruct(u32, u32, u8);

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: used a field initializer for a tuple struct
2-
--> $DIR/numbered_fields.rs:18:13
2+
--> $DIR/numbered_fields.rs:17:13
33
|
44
LL | let _ = TupleStruct {
55
| _____________^
@@ -13,7 +13,7 @@ LL | | };
1313
= help: to override `-D warnings` add `#[allow(clippy::init_numbered_fields)]`
1414

1515
error: used a field initializer for a tuple struct
16-
--> $DIR/numbered_fields.rs:25:13
16+
--> $DIR/numbered_fields.rs:24:13
1717
|
1818
LL | let _ = TupleStruct {
1919
| _____________^

src/tools/clippy/tests/ui/option_if_let_else.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![warn(clippy::option_if_let_else)]
22
#![allow(
3-
unused_tuple_struct_fields,
43
clippy::ref_option_ref,
54
clippy::equatable_if_let,
65
clippy::let_unit_value,

src/tools/clippy/tests/ui/option_if_let_else.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![warn(clippy::option_if_let_else)]
22
#![allow(
3-
unused_tuple_struct_fields,
43
clippy::ref_option_ref,
54
clippy::equatable_if_let,
65
clippy::let_unit_value,

0 commit comments

Comments
 (0)