Skip to content

Commit a0d81d1

Browse files
phanschflip1995
authored andcommitted
Pluralize disallowed_type lint filenames
This way they match up with the pluralized lint name as well.
1 parent b7f1891 commit a0d81d1

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

clippy_lints/src/lib.register_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ store.register_lints(&[
9999
derive::UNSAFE_DERIVE_DESERIALIZE,
100100
disallowed_method::DISALLOWED_METHOD,
101101
disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS,
102-
disallowed_type::DISALLOWED_TYPES,
102+
disallowed_types::DISALLOWED_TYPES,
103103
doc::DOC_MARKDOWN,
104104
doc::MISSING_ERRORS_DOC,
105105
doc::MISSING_PANICS_DOC,

clippy_lints/src/lib.register_nursery.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
77
LintId::of(cognitive_complexity::COGNITIVE_COMPLEXITY),
88
LintId::of(copies::BRANCHES_SHARING_CODE),
99
LintId::of(disallowed_method::DISALLOWED_METHOD),
10-
LintId::of(disallowed_type::DISALLOWED_TYPES),
10+
LintId::of(disallowed_types::DISALLOWED_TYPES),
1111
LintId::of(equatable_if_let::EQUATABLE_IF_LET),
1212
LintId::of(fallible_impl_from::FALLIBLE_IMPL_FROM),
1313
LintId::of(floating_point_arithmetic::IMPRECISE_FLOPS),

clippy_lints/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ mod derivable_impls;
196196
mod derive;
197197
mod disallowed_method;
198198
mod disallowed_script_idents;
199-
mod disallowed_type;
199+
mod disallowed_types;
200200
mod doc;
201201
mod double_comparison;
202202
mod double_parens;
@@ -827,7 +827,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
827827
store.register_early_pass(move || Box::new(module_style::ModStyle));
828828
store.register_late_pass(|| Box::new(unused_async::UnusedAsync));
829829
let disallowed_types = conf.disallowed_types.clone();
830-
store.register_late_pass(move || Box::new(disallowed_type::DisallowedTypes::new(disallowed_types.clone())));
830+
store.register_late_pass(move || Box::new(disallowed_types::DisallowedTypes::new(disallowed_types.clone())));
831831
let import_renames = conf.enforced_import_renames.clone();
832832
store.register_late_pass(move || {
833833
Box::new(missing_enforced_import_rename::ImportRename::new(

tests/ui-toml/toml_disallowed_type/conf_disallowed_type.stderr renamed to tests/ui-toml/toml_disallowed_types/conf_disallowed_types.stderr

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,129 @@
11
error: `std::sync::atomic::AtomicU32` is not allowed according to config
2-
--> $DIR/conf_disallowed_type.rs:7:1
2+
--> $DIR/conf_disallowed_types.rs:7:1
33
|
44
LL | use std::sync::atomic::AtomicU32;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::disallowed-types` implied by `-D warnings`
88

99
error: `std::time::Instant` is not allowed according to config
10-
--> $DIR/conf_disallowed_type.rs:8:1
10+
--> $DIR/conf_disallowed_types.rs:8:1
1111
|
1212
LL | use std::time::Instant as Sneaky;
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
error: `std::time::Instant` is not allowed according to config
16-
--> $DIR/conf_disallowed_type.rs:12:33
16+
--> $DIR/conf_disallowed_types.rs:12:33
1717
|
1818
LL | fn bad_return_type() -> fn() -> Sneaky {
1919
| ^^^^^^
2020

2121
error: `std::time::Instant` is not allowed according to config
22-
--> $DIR/conf_disallowed_type.rs:16:28
22+
--> $DIR/conf_disallowed_types.rs:16:28
2323
|
2424
LL | fn bad_arg_type(_: impl Fn(Sneaky) -> foo::atomic::AtomicU32) {}
2525
| ^^^^^^
2626

2727
error: `std::sync::atomic::AtomicU32` is not allowed according to config
28-
--> $DIR/conf_disallowed_type.rs:16:39
28+
--> $DIR/conf_disallowed_types.rs:16:39
2929
|
3030
LL | fn bad_arg_type(_: impl Fn(Sneaky) -> foo::atomic::AtomicU32) {}
3131
| ^^^^^^^^^^^^^^^^^^^^^^
3232

3333
error: `std::io::Read` is not allowed according to config
34-
--> $DIR/conf_disallowed_type.rs:18:22
34+
--> $DIR/conf_disallowed_types.rs:18:22
3535
|
3636
LL | fn trait_obj(_: &dyn std::io::Read) {}
3737
| ^^^^^^^^^^^^^
3838

3939
error: `usize` is not allowed according to config
40-
--> $DIR/conf_disallowed_type.rs:20:33
40+
--> $DIR/conf_disallowed_types.rs:20:33
4141
|
4242
LL | fn full_and_single_path_prim(_: usize, _: bool) {}
4343
| ^^^^^
4444

4545
error: `bool` is not allowed according to config
46-
--> $DIR/conf_disallowed_type.rs:20:43
46+
--> $DIR/conf_disallowed_types.rs:20:43
4747
|
4848
LL | fn full_and_single_path_prim(_: usize, _: bool) {}
4949
| ^^^^
5050

5151
error: `usize` is not allowed according to config
52-
--> $DIR/conf_disallowed_type.rs:22:28
52+
--> $DIR/conf_disallowed_types.rs:22:28
5353
|
5454
LL | fn const_generics<const C: usize>() {}
5555
| ^^^^^
5656

5757
error: `usize` is not allowed according to config
58-
--> $DIR/conf_disallowed_type.rs:24:24
58+
--> $DIR/conf_disallowed_types.rs:24:24
5959
|
6060
LL | struct GenArg<const U: usize>([u8; U]);
6161
| ^^^^^
6262

6363
error: `std::net::Ipv4Addr` is not allowed according to config
64-
--> $DIR/conf_disallowed_type.rs:28:10
64+
--> $DIR/conf_disallowed_types.rs:28:10
6565
|
6666
LL | fn ip(_: std::net::Ipv4Addr) {}
6767
| ^^^^^^^^^^^^^^^^^^
6868
|
6969
= note: no IPv4 allowed (from clippy.toml)
7070

7171
error: `std::net::TcpListener` is not allowed according to config
72-
--> $DIR/conf_disallowed_type.rs:30:16
72+
--> $DIR/conf_disallowed_types.rs:30:16
7373
|
7474
LL | fn listener(_: std::net::TcpListener) {}
7575
| ^^^^^^^^^^^^^^^^^^^^^
7676

7777
error: `std::collections::HashMap` is not allowed according to config
78-
--> $DIR/conf_disallowed_type.rs:34:48
78+
--> $DIR/conf_disallowed_types.rs:34:48
7979
|
8080
LL | let _: std::collections::HashMap<(), ()> = std::collections::HashMap::new();
8181
| ^^^^^^^^^^^^^^^^^^^^^^^^^
8282

8383
error: `std::collections::HashMap` is not allowed according to config
84-
--> $DIR/conf_disallowed_type.rs:34:12
84+
--> $DIR/conf_disallowed_types.rs:34:12
8585
|
8686
LL | let _: std::collections::HashMap<(), ()> = std::collections::HashMap::new();
8787
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8888

8989
error: `std::time::Instant` is not allowed according to config
90-
--> $DIR/conf_disallowed_type.rs:35:13
90+
--> $DIR/conf_disallowed_types.rs:35:13
9191
|
9292
LL | let _ = Sneaky::now();
9393
| ^^^^^^
9494

9595
error: `std::sync::atomic::AtomicU32` is not allowed according to config
96-
--> $DIR/conf_disallowed_type.rs:36:13
96+
--> $DIR/conf_disallowed_types.rs:36:13
9797
|
9898
LL | let _ = foo::atomic::AtomicU32::new(0);
9999
| ^^^^^^^^^^^^^^^^^^^^^^
100100

101101
error: `std::sync::atomic::AtomicU32` is not allowed according to config
102-
--> $DIR/conf_disallowed_type.rs:37:17
102+
--> $DIR/conf_disallowed_types.rs:37:17
103103
|
104104
LL | static FOO: std::sync::atomic::AtomicU32 = foo::atomic::AtomicU32::new(1);
105105
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106106

107107
error: `std::sync::atomic::AtomicU32` is not allowed according to config
108-
--> $DIR/conf_disallowed_type.rs:37:48
108+
--> $DIR/conf_disallowed_types.rs:37:48
109109
|
110110
LL | static FOO: std::sync::atomic::AtomicU32 = foo::atomic::AtomicU32::new(1);
111111
| ^^^^^^^^^^^^^^^^^^^^^^
112112

113113
error: `syn::TypePath` is not allowed according to config
114-
--> $DIR/conf_disallowed_type.rs:38:43
114+
--> $DIR/conf_disallowed_types.rs:38:43
115115
|
116116
LL | let _: std::collections::BTreeMap<(), syn::TypePath> = Default::default();
117117
| ^^^^^^^^^^^^^
118118

119119
error: `syn::Ident` is not allowed according to config
120-
--> $DIR/conf_disallowed_type.rs:39:13
120+
--> $DIR/conf_disallowed_types.rs:39:13
121121
|
122122
LL | let _ = syn::Ident::new("", todo!());
123123
| ^^^^^^^^^^
124124

125125
error: `usize` is not allowed according to config
126-
--> $DIR/conf_disallowed_type.rs:41:12
126+
--> $DIR/conf_disallowed_types.rs:41:12
127127
|
128128
LL | let _: usize = 64_usize;
129129
| ^^^^^

0 commit comments

Comments
 (0)