Skip to content

Commit b478256

Browse files
committed
Allow disallowed_names for tests
1 parent 34b0f4b commit b478256

File tree

8 files changed

+23
-19
lines changed

8 files changed

+23
-19
lines changed

tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.rs

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

44
pub mod foo {
55
// this line should produce a warning:

tests/ui/crashes/missing_const_for_fn_14774.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@compile-flags: -Z validate-mir
22
#![warn(clippy::missing_const_for_fn)]
3+
#![allow(clippy::disallowed_names)]
34

45
static BLOCK_FN_DEF: fn(usize) -> usize = {
56
//~v missing_const_for_fn

tests/ui/crashes/missing_const_for_fn_14774.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@compile-flags: -Z validate-mir
22
#![warn(clippy::missing_const_for_fn)]
3+
#![allow(clippy::disallowed_names)]
34

45
static BLOCK_FN_DEF: fn(usize) -> usize = {
56
//~v missing_const_for_fn

tests/ui/crashes/missing_const_for_fn_14774.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this could be a `const fn`
2-
--> tests/ui/crashes/missing_const_for_fn_14774.rs:6:5
2+
--> tests/ui/crashes/missing_const_for_fn_14774.rs:7:5
33
|
44
LL | / fn foo(a: usize) -> usize {
55
LL | | a + 10

tests/ui/return_and_then.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::return_and_then)]
2+
#![allow(clippy::disallowed_names)]
23

34
fn main() {
45
fn test_opt_block(opt: Option<i32>) -> Option<i32> {

tests/ui/return_and_then.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::return_and_then)]
2+
#![allow(clippy::disallowed_names)]
23

34
fn main() {
45
fn test_opt_block(opt: Option<i32>) -> Option<i32> {

tests/ui/return_and_then.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: use the `?` operator instead of an `and_then` call
2-
--> tests/ui/return_and_then.rs:5:9
2+
--> tests/ui/return_and_then.rs:6:9
33
|
44
LL | / opt.and_then(|n| {
55
LL | |
@@ -21,7 +21,7 @@ LL + if n > 1 { Some(ret) } else { None }
2121
|
2222

2323
error: use the `?` operator instead of an `and_then` call
24-
--> tests/ui/return_and_then.rs:14:9
24+
--> tests/ui/return_and_then.rs:15:9
2525
|
2626
LL | opt.and_then(|n| test_opt_block(Some(n)))
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -33,7 +33,7 @@ LL + test_opt_block(Some(n))
3333
|
3434

3535
error: use the `?` operator instead of an `and_then` call
36-
--> tests/ui/return_and_then.rs:19:9
36+
--> tests/ui/return_and_then.rs:20:9
3737
|
3838
LL | gen_option(1).and_then(|n| test_opt_block(Some(n)))
3939
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -45,7 +45,7 @@ LL + test_opt_block(Some(n))
4545
|
4646

4747
error: use the `?` operator instead of an `and_then` call
48-
--> tests/ui/return_and_then.rs:24:9
48+
--> tests/ui/return_and_then.rs:25:9
4949
|
5050
LL | opt.and_then(|n| if n > 1 { Ok(n + 1) } else { Err(n) })
5151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -57,7 +57,7 @@ LL + if n > 1 { Ok(n + 1) } else { Err(n) }
5757
|
5858

5959
error: use the `?` operator instead of an `and_then` call
60-
--> tests/ui/return_and_then.rs:29:9
60+
--> tests/ui/return_and_then.rs:30:9
6161
|
6262
LL | opt.and_then(|n| test_res_block(Ok(n)))
6363
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,7 +69,7 @@ LL + test_res_block(Ok(n))
6969
|
7070

7171
error: use the `?` operator instead of an `and_then` call
72-
--> tests/ui/return_and_then.rs:35:9
72+
--> tests/ui/return_and_then.rs:36:9
7373
|
7474
LL | Some("").and_then(|x| if x.len() > 2 { Some(3) } else { None })
7575
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -81,7 +81,7 @@ LL + if x.len() > 2 { Some(3) } else { None }
8181
|
8282

8383
error: use the `?` operator instead of an `and_then` call
84-
--> tests/ui/return_and_then.rs:41:9
84+
--> tests/ui/return_and_then.rs:42:9
8585
|
8686
LL | / Some(match (vec![1, 2, 3], vec![1, 2, 4]) {
8787
LL | |
@@ -102,7 +102,7 @@ LL + if x.len() > 2 { Some(3) } else { None }
102102
|
103103

104104
error: use the `?` operator instead of an `and_then` call
105-
--> tests/ui/return_and_then.rs:69:13
105+
--> tests/ui/return_and_then.rs:70:13
106106
|
107107
LL | Some("").and_then(|x| if x.len() > 2 { Some(3) } else { None })
108108
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL + if x.len() > 2 { Some(3) } else { None }
114114
|
115115

116116
error: use the `?` operator instead of an `and_then` call
117-
--> tests/ui/return_and_then.rs:77:20
117+
--> tests/ui/return_and_then.rs:78:20
118118
|
119119
LL | return Some("").and_then(|x| if x.len() > 2 { Some(3) } else { None });
120120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -128,7 +128,7 @@ LL ~ };
128128
|
129129

130130
error: use the `?` operator instead of an `and_then` call
131-
--> tests/ui/return_and_then.rs:85:20
131+
--> tests/ui/return_and_then.rs:86:20
132132
|
133133
LL | return Some("").and_then(|mut x| {
134134
| ____________________^

tests/ui/type_repetition_in_bounds.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: type `T` has already been used as a bound predicate
2-
--> tests/ui/type_repetition_in_bounds.rs:14:5
2+
--> tests/ui/type_repetition_in_bounds.rs:15:5
33
|
44
LL | T: Clone,
55
| ^^^^^^^^
@@ -12,47 +12,47 @@ LL | #![deny(clippy::type_repetition_in_bounds)]
1212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1313

1414
error: type `Self` has already been used as a bound predicate
15-
--> tests/ui/type_repetition_in_bounds.rs:32:5
15+
--> tests/ui/type_repetition_in_bounds.rs:33:5
1616
|
1717
LL | Self: Copy + Default + Ord,
1818
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
|
2020
= help: consider combining the bounds: `Self: Clone + Copy + Default + Ord`
2121

2222
error: type `T` has already been used as a bound predicate
23-
--> tests/ui/type_repetition_in_bounds.rs:107:5
23+
--> tests/ui/type_repetition_in_bounds.rs:108:5
2424
|
2525
LL | T: Clone,
2626
| ^^^^^^^^
2727
|
2828
= help: consider combining the bounds: `T: ?Sized + Clone`
2929

3030
error: type `T` has already been used as a bound predicate
31-
--> tests/ui/type_repetition_in_bounds.rs:113:5
31+
--> tests/ui/type_repetition_in_bounds.rs:114:5
3232
|
3333
LL | T: ?Sized,
3434
| ^^^^^^^^^
3535
|
3636
= help: consider combining the bounds: `T: Clone + ?Sized`
3737

3838
error: type `T` has already been used as a bound predicate
39-
--> tests/ui/type_repetition_in_bounds.rs:139:9
39+
--> tests/ui/type_repetition_in_bounds.rs:140:9
4040
|
4141
LL | T: Trait<Option<usize>, Box<[String]>, bool> + 'static,
4242
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4343
|
4444
= help: consider combining the bounds: `T: ?Sized + Trait<Option<usize>, Box<[String]>, bool> + 'static`
4545

4646
error: type `K` has already been used as a bound predicate
47-
--> tests/ui/type_repetition_in_bounds.rs:148:5
47+
--> tests/ui/type_repetition_in_bounds.rs:149:5
4848
|
4949
LL | K: Clone,
5050
| ^^^^^^^^
5151
|
5252
= help: consider combining the bounds: `K: 'a + Clone`
5353

5454
error: type `Vec<T>` has already been used as a bound predicate
55-
--> tests/ui/type_repetition_in_bounds.rs:157:5
55+
--> tests/ui/type_repetition_in_bounds.rs:158:5
5656
|
5757
LL | Vec<T>: Clone,
5858
| ^^^^^^^^^^^^^

0 commit comments

Comments
 (0)