Skip to content

Commit 39f4bee

Browse files
committed
Move only_used_in_recursion back into complexity
1 parent d95b675 commit 39f4bee

5 files changed

+9
-8
lines changed

clippy_lints/src/lib.register_all.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
252252
LintId::of(non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
253253
LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS),
254254
LintId::of(octal_escapes::OCTAL_ESCAPES),
255+
LintId::of(only_used_in_recursion::ONLY_USED_IN_RECURSION),
255256
LintId::of(operators::ABSURD_EXTREME_COMPARISONS),
256257
LintId::of(operators::ASSIGN_OP_PATTERN),
257258
LintId::of(operators::BAD_BIT_MASK),

clippy_lints/src/lib.register_complexity.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec!
7272
LintId::of(neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD),
7373
LintId::of(no_effect::NO_EFFECT),
7474
LintId::of(no_effect::UNNECESSARY_OPERATION),
75+
LintId::of(only_used_in_recursion::ONLY_USED_IN_RECURSION),
7576
LintId::of(operators::DOUBLE_COMPARISONS),
7677
LintId::of(operators::DURATION_SUBSEC),
7778
LintId::of(operators::IDENTITY_OP),

clippy_lints/src/lib.register_nursery.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
2424
LintId::of(mutex_atomic::MUTEX_INTEGER),
2525
LintId::of(non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY),
2626
LintId::of(nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES),
27-
LintId::of(only_used_in_recursion::ONLY_USED_IN_RECURSION),
2827
LintId::of(option_if_let_else::OPTION_IF_LET_ELSE),
2928
LintId::of(redundant_pub_crate::REDUNDANT_PUB_CRATE),
3029
LintId::of(regex::TRIVIAL_REGEX),

clippy_lints/src/only_used_in_recursion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ declare_clippy_lint! {
8080
/// ```
8181
#[clippy::version = "1.61.0"]
8282
pub ONLY_USED_IN_RECURSION,
83-
nursery,
83+
complexity,
8484
"arguments that is only used in recursion can be removed"
8585
}
8686
impl_lint_pass!(OnlyUsedInRecursion => [ONLY_USED_IN_RECURSION]);

clippy_lints/src/redundant_static_lifetimes.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ impl_lint_pass!(RedundantStaticLifetimes => [REDUNDANT_STATIC_LIFETIMES]);
4848

4949
impl RedundantStaticLifetimes {
5050
// Recursively visit types
51-
fn visit_type(&mut self, ty: &Ty, cx: &EarlyContext<'_>, reason: &str) {
51+
fn visit_type(ty: &Ty, cx: &EarlyContext<'_>, reason: &str) {
5252
match ty.kind {
5353
// Be careful of nested structures (arrays and tuples)
5454
TyKind::Array(ref ty, _) | TyKind::Slice(ref ty) => {
55-
self.visit_type(ty, cx, reason);
55+
Self::visit_type(ty, cx, reason);
5656
},
5757
TyKind::Tup(ref tup) => {
5858
for tup_ty in tup {
59-
self.visit_type(tup_ty, cx, reason);
59+
Self::visit_type(tup_ty, cx, reason);
6060
}
6161
},
6262
// This is what we are looking for !
@@ -87,7 +87,7 @@ impl RedundantStaticLifetimes {
8787
_ => {},
8888
}
8989
}
90-
self.visit_type(&borrow_type.ty, cx, reason);
90+
Self::visit_type(&borrow_type.ty, cx, reason);
9191
},
9292
_ => {},
9393
}
@@ -102,13 +102,13 @@ impl EarlyLintPass for RedundantStaticLifetimes {
102102

103103
if !item.span.from_expansion() {
104104
if let ItemKind::Const(_, ref var_type, _) = item.kind {
105-
self.visit_type(var_type, cx, "constants have by default a `'static` lifetime");
105+
Self::visit_type(var_type, cx, "constants have by default a `'static` lifetime");
106106
// Don't check associated consts because `'static` cannot be elided on those (issue
107107
// #2438)
108108
}
109109

110110
if let ItemKind::Static(ref var_type, _, _) = item.kind {
111-
self.visit_type(var_type, cx, "statics have by default a `'static` lifetime");
111+
Self::visit_type(var_type, cx, "statics have by default a `'static` lifetime");
112112
}
113113
}
114114
}

0 commit comments

Comments
 (0)