Skip to content

Commit 66b4674

Browse files
committed
Change lint name to plural
1 parent 2f48257 commit 66b4674

Some content is hidden

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

46 files changed

+89
-79
lines changed

CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ Released 2021-09-09
965965
[#7407](https://github.com/rust-lang/rust-clippy/pull/7407)
966966
* [`redundant_allocation`]: Now additionally supports the `Arc<>` type
967967
[#7308](https://github.com/rust-lang/rust-clippy/pull/7308)
968-
* [`disallowed_name`]: Now allows disallowed names in test code
968+
* [`disallowed_names`]: Now allows disallowed names in test code
969969
[#7379](https://github.com/rust-lang/rust-clippy/pull/7379)
970970
* [`redundant_closure`]: Suggests `&mut` for `FnMut`
971971
[#7437](https://github.com/rust-lang/rust-clippy/pull/7437)
@@ -2066,7 +2066,7 @@ Released 2020-08-27
20662066
[#5692](https://github.com/rust-lang/rust-clippy/pull/5692)
20672067
* [`if_same_then_else`]: Don't assume multiplication is always commutative
20682068
[#5702](https://github.com/rust-lang/rust-clippy/pull/5702)
2069-
* [`disallowed_name`]: Remove `bar` from the default configuration
2069+
* [`disallowed_names`]: Remove `bar` from the default configuration
20702070
[#5712](https://github.com/rust-lang/rust-clippy/pull/5712)
20712071
* [`redundant_pattern_matching`]: Avoid suggesting non-`const fn` calls in const contexts
20722072
[#5724](https://github.com/rust-lang/rust-clippy/pull/5724)
@@ -3522,7 +3522,7 @@ Released 2018-09-13
35223522
[`derive_partial_eq_without_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
35233523
[`disallowed_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_method
35243524
[`disallowed_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
3525-
[`disallowed_name`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_name
3525+
[`disallowed_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names
35263526
[`disallowed_script_idents`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_script_idents
35273527
[`disallowed_type`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_type
35283528
[`disallowed_types`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types

clippy_lints/src/disallowed_name.rs renamed to clippy_lints/src/disallowed_names.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ declare_clippy_lint! {
1818
/// let foo = 3.14;
1919
/// ```
2020
#[clippy::version = "pre 1.29.0"]
21-
pub DISALLOWED_NAME,
21+
pub DISALLOWED_NAMES,
2222
style,
2323
"usage of a disallowed/placeholder name"
2424
}
2525

2626
#[derive(Clone, Debug)]
27-
pub struct DisallowedName {
27+
pub struct DisallowedNames {
2828
disallow: FxHashSet<String>,
2929
test_modules_deep: u32,
3030
}
3131

32-
impl DisallowedName {
32+
impl DisallowedNames {
3333
pub fn new(disallow: FxHashSet<String>) -> Self {
3434
Self {
3535
disallow,
@@ -42,9 +42,9 @@ impl DisallowedName {
4242
}
4343
}
4444

45-
impl_lint_pass!(DisallowedName => [DISALLOWED_NAME]);
45+
impl_lint_pass!(DisallowedNames => [DISALLOWED_NAMES]);
4646

47-
impl<'tcx> LateLintPass<'tcx> for DisallowedName {
47+
impl<'tcx> LateLintPass<'tcx> for DisallowedNames {
4848
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
4949
if is_test_module_or_function(cx.tcx, item) {
5050
self.test_modules_deep = self.test_modules_deep.saturating_add(1);
@@ -61,7 +61,7 @@ impl<'tcx> LateLintPass<'tcx> for DisallowedName {
6161
if self.disallow.contains(&ident.name.to_string()) {
6262
span_lint(
6363
cx,
64-
DISALLOWED_NAME,
64+
DISALLOWED_NAMES,
6565
ident.span,
6666
&format!("use of a disallowed/placeholder name `{}`", ident.name),
6767
);

clippy_lints/src/lib.register_all.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
4646
LintId::of(derive::DERIVE_ORD_XOR_PARTIAL_ORD),
4747
LintId::of(derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ),
4848
LintId::of(disallowed_methods::DISALLOWED_METHODS),
49-
LintId::of(disallowed_name::DISALLOWED_NAME),
49+
LintId::of(disallowed_names::DISALLOWED_NAMES),
5050
LintId::of(disallowed_types::DISALLOWED_TYPES),
5151
LintId::of(doc::MISSING_SAFETY_DOC),
5252
LintId::of(doc::NEEDLESS_DOCTEST_MAIN),

clippy_lints/src/lib.register_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ store.register_lints(&[
115115
derive::EXPL_IMPL_CLONE_ON_COPY,
116116
derive::UNSAFE_DERIVE_DESERIALIZE,
117117
disallowed_methods::DISALLOWED_METHODS,
118-
disallowed_name::DISALLOWED_NAME,
118+
disallowed_names::DISALLOWED_NAMES,
119119
disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS,
120120
disallowed_types::DISALLOWED_TYPES,
121121
doc::DOC_MARKDOWN,

clippy_lints/src/lib.register_style.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
1717
LintId::of(dereference::NEEDLESS_BORROW),
1818
LintId::of(derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ),
1919
LintId::of(disallowed_methods::DISALLOWED_METHODS),
20-
LintId::of(disallowed_name::DISALLOWED_NAME),
20+
LintId::of(disallowed_names::DISALLOWED_NAMES),
2121
LintId::of(disallowed_types::DISALLOWED_TYPES),
2222
LintId::of(doc::MISSING_SAFETY_DOC),
2323
LintId::of(doc::NEEDLESS_DOCTEST_MAIN),

clippy_lints/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ mod dereference;
204204
mod derivable_impls;
205205
mod derive;
206206
mod disallowed_methods;
207-
mod disallowed_name;
207+
mod disallowed_names;
208208
mod disallowed_script_idents;
209209
mod disallowed_types;
210210
mod doc;
@@ -684,7 +684,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
684684
store.register_late_pass(|| Box::new(overflow_check_conditional::OverflowCheckConditional));
685685
store.register_late_pass(|| Box::new(new_without_default::NewWithoutDefault::default()));
686686
let disallowed_names = conf.disallowed_names.iter().cloned().collect::<FxHashSet<_>>();
687-
store.register_late_pass(move || Box::new(disallowed_name::DisallowedName::new(disallowed_names.clone())));
687+
store.register_late_pass(move || Box::new(disallowed_names::DisallowedNames::new(disallowed_names.clone())));
688688
let too_many_arguments_threshold = conf.too_many_arguments_threshold;
689689
let too_many_lines_threshold = conf.too_many_lines_threshold;
690690
store.register_late_pass(move || {

clippy_lints/src/renamed_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
55
("clippy::block_in_if_condition_expr", "clippy::blocks_in_if_conditions"),
66
("clippy::block_in_if_condition_stmt", "clippy::blocks_in_if_conditions"),
77
("clippy::box_vec", "clippy::box_collection"),
8-
("clippy::blacklisted_name", "clippy::disallowed_name"),
8+
("clippy::blacklisted_name", "clippy::disallowed_names"),
99
("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes"),
1010
("clippy::cyclomatic_complexity", "clippy::cognitive_complexity"),
1111
("clippy::disallowed_method", "clippy::disallowed_methods"),

clippy_lints/src/utils/conf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ define_Conf! {
231231
/// Use the Cognitive Complexity lint instead.
232232
#[conf_deprecated("Please use `cognitive-complexity-threshold` instead", cognitive_complexity_threshold)]
233233
(cyclomatic_complexity_threshold: u64 = 25),
234-
/// Lint: DISALLOWED_NAME.
234+
/// Lint: DISALLOWED_NAMES.
235235
///
236236
/// The list of disallowed names to lint about. NB: `bar` is not here since it has legitimate uses. The value
237237
/// `".."` can be used as part of the list to indicate, that the configured values should be appended to the

tests/ui-toml/disallowed_names_append/disallowed_names.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[warn(clippy::disallowed_name)]
1+
#[warn(clippy::disallowed_names)]
22

33
fn main() {
44
// `foo` is part of the default configuration

tests/ui-toml/disallowed_names_append/disallowed_names.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: use of a disallowed/placeholder name `foo`
44
LL | let foo = "bar";
55
| ^^^
66
|
7-
= note: `-D clippy::disallowed-name` implied by `-D warnings`
7+
= note: `-D clippy::disallowed-names` implied by `-D warnings`
88

99
error: use of a disallowed/placeholder name `ducks`
1010
--> $DIR/disallowed_names.rs:7:9

tests/ui-toml/disallowed_names_replace/disallowed_names.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[warn(clippy::disallowed_name)]
1+
#[warn(clippy::disallowed_names)]
22

33
fn main() {
44
// `foo` is part of the default configuration

tests/ui-toml/disallowed_names_replace/disallowed_names.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: use of a disallowed/placeholder name `ducks`
44
LL | let ducks = ["quack", "quack"];
55
| ^^^^^
66
|
7-
= note: `-D clippy::disallowed-name` implied by `-D warnings`
7+
= note: `-D clippy::disallowed-names` implied by `-D warnings`
88

99
error: aborting due to previous error
1010

tests/ui-toml/toml_disallow/conf_french_disallowed_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(dead_code)]
22
#![allow(clippy::single_match)]
33
#![allow(unused_variables)]
4-
#![warn(clippy::disallowed_name)]
4+
#![warn(clippy::disallowed_names)]
55

66
fn test(toto: ()) {}
77

tests/ui-toml/toml_disallow/conf_french_disallowed_name.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: use of a disallowed/placeholder name `toto`
44
LL | fn test(toto: ()) {}
55
| ^^^^
66
|
7-
= note: `-D clippy::disallowed-name` implied by `-D warnings`
7+
= note: `-D clippy::disallowed-names` implied by `-D warnings`
88

99
error: use of a disallowed/placeholder name `toto`
1010
--> $DIR/conf_french_disallowed_name.rs:9:9

tests/ui/borrow_box.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![deny(clippy::borrowed_box)]
2-
#![allow(clippy::disallowed_name)]
2+
#![allow(clippy::disallowed_names)]
33
#![allow(unused_variables)]
44
#![allow(dead_code)]
55

tests/ui/box_collection.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#![warn(clippy::all)]
2-
#![allow(clippy::boxed_local, clippy::needless_pass_by_value, clippy::disallowed_name, unused)]
2+
#![allow(
3+
clippy::boxed_local,
4+
clippy::needless_pass_by_value,
5+
clippy::disallowed_names,
6+
unused
7+
)]
38

49
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, LinkedList, VecDeque};
510

tests/ui/box_collection.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: you seem to be trying to use `Box<Vec<..>>`. Consider using just `Vec<..>`
2-
--> $DIR/box_collection.rs:16:15
2+
--> $DIR/box_collection.rs:21:15
33
|
44
LL | fn test1(foo: Box<Vec<bool>>) {}
55
| ^^^^^^^^^^^^^^
@@ -8,63 +8,63 @@ LL | fn test1(foo: Box<Vec<bool>>) {}
88
= help: `Vec<..>` is already on the heap, `Box<Vec<..>>` makes an extra allocation
99

1010
error: you seem to be trying to use `Box<String>`. Consider using just `String`
11-
--> $DIR/box_collection.rs:23:15
11+
--> $DIR/box_collection.rs:28:15
1212
|
1313
LL | fn test3(foo: Box<String>) {}
1414
| ^^^^^^^^^^^
1515
|
1616
= help: `String` is already on the heap, `Box<String>` makes an extra allocation
1717

1818
error: you seem to be trying to use `Box<HashMap<..>>`. Consider using just `HashMap<..>`
19-
--> $DIR/box_collection.rs:25:15
19+
--> $DIR/box_collection.rs:30:15
2020
|
2121
LL | fn test4(foo: Box<HashMap<String, String>>) {}
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2323
|
2424
= help: `HashMap<..>` is already on the heap, `Box<HashMap<..>>` makes an extra allocation
2525

2626
error: you seem to be trying to use `Box<HashSet<..>>`. Consider using just `HashSet<..>`
27-
--> $DIR/box_collection.rs:27:15
27+
--> $DIR/box_collection.rs:32:15
2828
|
2929
LL | fn test5(foo: Box<HashSet<i64>>) {}
3030
| ^^^^^^^^^^^^^^^^^
3131
|
3232
= help: `HashSet<..>` is already on the heap, `Box<HashSet<..>>` makes an extra allocation
3333

3434
error: you seem to be trying to use `Box<VecDeque<..>>`. Consider using just `VecDeque<..>`
35-
--> $DIR/box_collection.rs:29:15
35+
--> $DIR/box_collection.rs:34:15
3636
|
3737
LL | fn test6(foo: Box<VecDeque<i32>>) {}
3838
| ^^^^^^^^^^^^^^^^^^
3939
|
4040
= help: `VecDeque<..>` is already on the heap, `Box<VecDeque<..>>` makes an extra allocation
4141

4242
error: you seem to be trying to use `Box<LinkedList<..>>`. Consider using just `LinkedList<..>`
43-
--> $DIR/box_collection.rs:31:15
43+
--> $DIR/box_collection.rs:36:15
4444
|
4545
LL | fn test7(foo: Box<LinkedList<i16>>) {}
4646
| ^^^^^^^^^^^^^^^^^^^^
4747
|
4848
= help: `LinkedList<..>` is already on the heap, `Box<LinkedList<..>>` makes an extra allocation
4949

5050
error: you seem to be trying to use `Box<BTreeMap<..>>`. Consider using just `BTreeMap<..>`
51-
--> $DIR/box_collection.rs:33:15
51+
--> $DIR/box_collection.rs:38:15
5252
|
5353
LL | fn test8(foo: Box<BTreeMap<i8, String>>) {}
5454
| ^^^^^^^^^^^^^^^^^^^^^^^^^
5555
|
5656
= help: `BTreeMap<..>` is already on the heap, `Box<BTreeMap<..>>` makes an extra allocation
5757

5858
error: you seem to be trying to use `Box<BTreeSet<..>>`. Consider using just `BTreeSet<..>`
59-
--> $DIR/box_collection.rs:35:15
59+
--> $DIR/box_collection.rs:40:15
6060
|
6161
LL | fn test9(foo: Box<BTreeSet<u64>>) {}
6262
| ^^^^^^^^^^^^^^^^^^
6363
|
6464
= help: `BTreeSet<..>` is already on the heap, `Box<BTreeSet<..>>` makes an extra allocation
6565

6666
error: you seem to be trying to use `Box<BinaryHeap<..>>`. Consider using just `BinaryHeap<..>`
67-
--> $DIR/box_collection.rs:37:16
67+
--> $DIR/box_collection.rs:42:16
6868
|
6969
LL | fn test10(foo: Box<BinaryHeap<u32>>) {}
7070
| ^^^^^^^^^^^^^^^^^^^^

tests/ui/crashes/ice-2760.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
#![allow(unused_variables, clippy::disallowed_name, clippy::needless_pass_by_value, dead_code)]
1+
#![allow(
2+
unused_variables,
3+
clippy::disallowed_names,
4+
clippy::needless_pass_by_value,
5+
dead_code
6+
)]
27

38
/// This should not compile-fail with:
49
///

tests/ui/crashes/ice-3462.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::all)]
2-
#![allow(clippy::disallowed_name, clippy::equatable_if_let)]
2+
#![allow(clippy::disallowed_names, clippy::equatable_if_let)]
33
#![allow(unused)]
44

55
/// Test for https://github.com/rust-lang/rust-clippy/issues/3462

tests/ui/crashes/regressions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::disallowed_name)]
1+
#![allow(clippy::disallowed_names)]
22

33
pub fn foo(bar: *const u8) {
44
println!("{:#p}", bar);

tests/ui/disallowed_name.rs renamed to tests/ui/disallowed_names.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
unused_mut,
77
unused_variables
88
)]
9-
#![warn(clippy::disallowed_name)]
9+
#![warn(clippy::disallowed_names)]
1010

1111
fn test(foo: ()) {}
1212

@@ -46,7 +46,7 @@ fn issue_1647_ref_mut() {
4646

4747
mod tests {
4848
fn issue_7305() {
49-
// `disallowed_name` lint should not be triggered inside of the test code.
49+
// `disallowed_names` lint should not be triggered inside of the test code.
5050
let foo = 0;
5151

5252
// Check that even in nested functions warning is still not triggered.

0 commit comments

Comments
 (0)