Skip to content

Commit 029b8d2

Browse files
committed
Attributes cleanup in tests [12/20]
1 parent 75bff05 commit 029b8d2

79 files changed

Lines changed: 278 additions & 377 deletions

File tree

Some content is hidden

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

tests/ui/methods.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
//@aux-build:option_helpers.rs
22

3-
#![allow(
4-
clippy::disallowed_names,
5-
clippy::default_trait_access,
6-
clippy::let_underscore_untyped,
7-
clippy::missing_docs_in_private_items,
8-
clippy::missing_safety_doc,
9-
clippy::non_ascii_literal,
10-
clippy::new_without_default,
11-
clippy::needless_pass_by_value,
12-
clippy::needless_lifetimes,
13-
clippy::elidable_lifetime_names,
14-
clippy::print_stdout,
15-
clippy::must_use_candidate,
16-
clippy::use_self,
17-
clippy::useless_format,
18-
clippy::wrong_self_convention,
19-
clippy::unused_async,
20-
clippy::unused_self,
21-
clippy::useless_vec
22-
)]
3+
#![warn(clippy::filter_next, clippy::new_ret_no_self)]
4+
#![expect(clippy::disallowed_names, clippy::useless_vec)]
235

246
#[macro_use]
257
extern crate option_helpers;

tests/ui/methods.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: methods called `new` usually return `Self`
2-
--> tests/ui/methods.rs:102:5
2+
--> tests/ui/methods.rs:84:5
33
|
44
LL | / fn new() -> i32 {
55
LL | |
@@ -11,7 +11,7 @@ LL | | }
1111
= help: to override `-D warnings` add `#[allow(clippy::new_ret_no_self)]`
1212

1313
error: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
14-
--> tests/ui/methods.rs:124:13
14+
--> tests/ui/methods.rs:106:13
1515
|
1616
LL | let _ = v.iter().filter(|&x| {
1717
| _____________^
@@ -25,7 +25,7 @@ LL | | ).next();
2525
= help: to override `-D warnings` add `#[allow(clippy::filter_next)]`
2626

2727
error: called `filter(..).next_back()` on an `DoubleEndedIterator`. This is more succinctly expressed by calling `.rfind(..)` instead
28-
--> tests/ui/methods.rs:143:13
28+
--> tests/ui/methods.rs:125:13
2929
|
3030
LL | let _ = v.iter().filter(|&x| {
3131
| _____________^

tests/ui/methods_fixable.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::filter_next)]
2-
#![allow(clippy::useless_vec)]
2+
#![expect(clippy::useless_vec)]
33

44
/// Checks implementation of `FILTER_NEXT` lint.
55
fn main() {

tests/ui/methods_fixable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::filter_next)]
2-
#![allow(clippy::useless_vec)]
2+
#![expect(clippy::useless_vec)]
33

44
/// Checks implementation of `FILTER_NEXT` lint.
55
fn main() {

tests/ui/min_ident_chars.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@aux-build:proc_macros.rs
2-
#![allow(irrefutable_let_patterns, nonstandard_style, unused)]
3-
#![allow(clippy::struct_field_names)]
42
#![warn(clippy::min_ident_chars)]
3+
#![expect(irrefutable_let_patterns, nonstandard_style)]
4+
#![allow(clippy::struct_field_names)]
55

66
extern crate proc_macros;
77
use proc_macros::{external, with_span};

tests/ui/min_max.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#![allow(clippy::manual_clamp)]
1+
#![warn(clippy::min_max)]
2+
#![expect(clippy::manual_clamp)]
23

34
use std::cmp::{max as my_max, max, min as my_min, min};
45

tests/ui/min_max.stderr

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,80 @@
11
error: this `min`/`max` combination leads to constant result
2-
--> tests/ui/min_max.rs:21:5
2+
--> tests/ui/min_max.rs:22:5
33
|
44
LL | min(1, max(3, x));
55
| ^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[deny(clippy::min_max)]` on by default
7+
= note: `-D clippy::min-max` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::min_max)]`
89

910
error: this `min`/`max` combination leads to constant result
10-
--> tests/ui/min_max.rs:24:5
11+
--> tests/ui/min_max.rs:25:5
1112
|
1213
LL | min(max(3, x), 1);
1314
| ^^^^^^^^^^^^^^^^^
1415

1516
error: this `min`/`max` combination leads to constant result
16-
--> tests/ui/min_max.rs:27:5
17+
--> tests/ui/min_max.rs:28:5
1718
|
1819
LL | max(min(x, 1), 3);
1920
| ^^^^^^^^^^^^^^^^^
2021

2122
error: this `min`/`max` combination leads to constant result
22-
--> tests/ui/min_max.rs:30:5
23+
--> tests/ui/min_max.rs:31:5
2324
|
2425
LL | max(3, min(x, 1));
2526
| ^^^^^^^^^^^^^^^^^
2627

2728
error: this `min`/`max` combination leads to constant result
28-
--> tests/ui/min_max.rs:33:5
29+
--> tests/ui/min_max.rs:34:5
2930
|
3031
LL | my_max(3, my_min(x, 1));
3132
| ^^^^^^^^^^^^^^^^^^^^^^^
3233

3334
error: this `min`/`max` combination leads to constant result
34-
--> tests/ui/min_max.rs:44:5
35+
--> tests/ui/min_max.rs:45:5
3536
|
3637
LL | min("Apple", max("Zoo", s));
3738
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
3839

3940
error: this `min`/`max` combination leads to constant result
40-
--> tests/ui/min_max.rs:47:5
41+
--> tests/ui/min_max.rs:48:5
4142
|
4243
LL | max(min(s, "Apple"), "Zoo");
4344
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
4445

4546
error: this `min`/`max` combination leads to constant result
46-
--> tests/ui/min_max.rs:53:5
47+
--> tests/ui/min_max.rs:54:5
4748
|
4849
LL | x.min(1).max(3);
4950
| ^^^^^^^^^^^^^^^
5051

5152
error: this `min`/`max` combination leads to constant result
52-
--> tests/ui/min_max.rs:56:5
53+
--> tests/ui/min_max.rs:57:5
5354
|
5455
LL | x.max(3).min(1);
5556
| ^^^^^^^^^^^^^^^
5657

5758
error: this `min`/`max` combination leads to constant result
58-
--> tests/ui/min_max.rs:59:5
59+
--> tests/ui/min_max.rs:60:5
5960
|
6061
LL | f.max(3f32).min(1f32);
6162
| ^^^^^^^^^^^^^^^^^^^^^
6263

6364
error: this `min`/`max` combination leads to constant result
64-
--> tests/ui/min_max.rs:66:5
65+
--> tests/ui/min_max.rs:67:5
6566
|
6667
LL | max(x.min(1), 3);
6768
| ^^^^^^^^^^^^^^^^
6869

6970
error: this `min`/`max` combination leads to constant result
70-
--> tests/ui/min_max.rs:71:5
71+
--> tests/ui/min_max.rs:72:5
7172
|
7273
LL | s.max("Zoo").min("Apple");
7374
| ^^^^^^^^^^^^^^^^^^^^^^^^^
7475

7576
error: this `min`/`max` combination leads to constant result
76-
--> tests/ui/min_max.rs:74:5
77+
--> tests/ui/min_max.rs:75:5
7778
|
7879
LL | s.min("Apple").max("Zoo");
7980
| ^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/min_rust_version_attr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![allow(clippy::redundant_clone)]
21
#![feature(custom_inner_attributes)]
32

43
fn main() {}

tests/ui/min_rust_version_attr.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: approximate value of `f{32, 64}::consts::LOG2_10` found
2-
--> tests/ui/min_rust_version_attr.rs:13:19
2+
--> tests/ui/min_rust_version_attr.rs:12:19
33
|
44
LL | let log2_10 = 3.321928094887362;
55
| ^^^^^^^^^^^^^^^^^
@@ -8,39 +8,39 @@ LL | let log2_10 = 3.321928094887362;
88
= note: `#[deny(clippy::approx_constant)]` on by default
99

1010
error: approximate value of `f{32, 64}::consts::LOG2_10` found
11-
--> tests/ui/min_rust_version_attr.rs:19:19
11+
--> tests/ui/min_rust_version_attr.rs:18:19
1212
|
1313
LL | let log2_10 = 3.321928094887362;
1414
| ^^^^^^^^^^^^^^^^^
1515
|
1616
= help: consider using the constant directly
1717

1818
error: approximate value of `f{32, 64}::consts::LOG2_10` found
19-
--> tests/ui/min_rust_version_attr.rs:30:19
19+
--> tests/ui/min_rust_version_attr.rs:29:19
2020
|
2121
LL | let log2_10 = 3.321928094887362;
2222
| ^^^^^^^^^^^^^^^^^
2323
|
2424
= help: consider using the constant directly
2525

2626
error: approximate value of `f{32, 64}::consts::LOG2_10` found
27-
--> tests/ui/min_rust_version_attr.rs:41:19
27+
--> tests/ui/min_rust_version_attr.rs:40:19
2828
|
2929
LL | let log2_10 = 3.321928094887362;
3030
| ^^^^^^^^^^^^^^^^^
3131
|
3232
= help: consider using the constant directly
3333

3434
error: approximate value of `f{32, 64}::consts::LOG2_10` found
35-
--> tests/ui/min_rust_version_attr.rs:52:19
35+
--> tests/ui/min_rust_version_attr.rs:51:19
3636
|
3737
LL | let log2_10 = 3.321928094887362;
3838
| ^^^^^^^^^^^^^^^^^
3939
|
4040
= help: consider using the constant directly
4141

4242
error: approximate value of `f{32, 64}::consts::LOG2_10` found
43-
--> tests/ui/min_rust_version_attr.rs:60:27
43+
--> tests/ui/min_rust_version_attr.rs:59:27
4444
|
4545
LL | let log2_10 = 3.321928094887362;
4646
| ^^^^^^^^^^^^^^^^^

tests/ui/mismatching_type_param_order.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::mismatching_type_param_order)]
2-
#![allow(clippy::disallowed_names, clippy::needless_lifetimes)]
32

43
fn main() {
54
struct Foo<A, B> {

0 commit comments

Comments
 (0)