Skip to content

Commit bcbb07f

Browse files
committed
Rename RecursiveFormatImpl to FormatImpl
1 parent 4417f78 commit bcbb07f

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

clippy_lints/src/recursive_format_impl.rs renamed to clippy_lints/src/format_impl.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ impl FormatTrait {
2121
}
2222
}
2323
}
24-
2524
declare_clippy_lint! {
2625
/// ### What it does
2726
/// Checks for format trait implementations (e.g. `Display`) with a recursive call to itself
@@ -62,22 +61,22 @@ declare_clippy_lint! {
6261
}
6362

6463
#[derive(Default)]
65-
pub struct RecursiveFormatImpl {
64+
pub struct FormatImpl {
6665
// Whether we are inside Display or Debug trait impl - None for neither
6766
format_trait_impl: Option<FormatTrait>,
6867
}
6968

70-
impl RecursiveFormatImpl {
69+
impl FormatImpl {
7170
pub fn new() -> Self {
7271
Self {
7372
format_trait_impl: None,
7473
}
7574
}
7675
}
7776

78-
impl_lint_pass!(RecursiveFormatImpl => [RECURSIVE_FORMAT_IMPL]);
77+
impl_lint_pass!(FormatImpl => [RECURSIVE_FORMAT_IMPL]);
7978

80-
impl<'tcx> LateLintPass<'tcx> for RecursiveFormatImpl {
79+
impl<'tcx> LateLintPass<'tcx> for FormatImpl {
8180
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
8281
if let Some(format_trait_impl) = is_format_trait_impl(cx, item) {
8382
self.format_trait_impl = Some(format_trait_impl);

clippy_lints/src/lib.register_all.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
6868
LintId::of(format::USELESS_FORMAT),
6969
LintId::of(format_args::FORMAT_IN_FORMAT_ARGS),
7070
LintId::of(format_args::TO_STRING_IN_FORMAT_ARGS),
71+
LintId::of(format_impl::RECURSIVE_FORMAT_IMPL),
7172
LintId::of(formatting::POSSIBLE_MISSING_COMMA),
7273
LintId::of(formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
7374
LintId::of(formatting::SUSPICIOUS_ELSE_FORMATTING),
@@ -244,7 +245,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
244245
LintId::of(ranges::MANUAL_RANGE_CONTAINS),
245246
LintId::of(ranges::RANGE_ZIP_WITH_LEN),
246247
LintId::of(ranges::REVERSED_EMPTY_RANGES),
247-
LintId::of(recursive_format_impl::RECURSIVE_FORMAT_IMPL),
248248
LintId::of(redundant_clone::REDUNDANT_CLONE),
249249
LintId::of(redundant_closure_call::REDUNDANT_CLOSURE_CALL),
250250
LintId::of(redundant_field_names::REDUNDANT_FIELD_NAMES),

clippy_lints/src/lib.register_correctness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ store.register_group(true, "clippy::correctness", Some("clippy_correctness"), ve
2424
LintId::of(enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
2525
LintId::of(eq_op::EQ_OP),
2626
LintId::of(erasing_op::ERASING_OP),
27+
LintId::of(format_impl::RECURSIVE_FORMAT_IMPL),
2728
LintId::of(formatting::POSSIBLE_MISSING_COMMA),
2829
LintId::of(functions::NOT_UNSAFE_PTR_ARG_DEREF),
2930
LintId::of(if_let_mutex::IF_LET_MUTEX),
@@ -52,7 +53,6 @@ store.register_group(true, "clippy::correctness", Some("clippy_correctness"), ve
5253
LintId::of(ptr::INVALID_NULL_PTR_USAGE),
5354
LintId::of(ptr::MUT_FROM_REF),
5455
LintId::of(ranges::REVERSED_EMPTY_RANGES),
55-
LintId::of(recursive_format_impl::RECURSIVE_FORMAT_IMPL),
5656
LintId::of(regex::INVALID_REGEX),
5757
LintId::of(self_assignment::SELF_ASSIGNMENT),
5858
LintId::of(serde_api::SERDE_API_MISUSE),

clippy_lints/src/lib.register_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ store.register_lints(&[
152152
format::USELESS_FORMAT,
153153
format_args::FORMAT_IN_FORMAT_ARGS,
154154
format_args::TO_STRING_IN_FORMAT_ARGS,
155+
format_impl::RECURSIVE_FORMAT_IMPL,
155156
formatting::POSSIBLE_MISSING_COMMA,
156157
formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
157158
formatting::SUSPICIOUS_ELSE_FORMATTING,
@@ -417,7 +418,6 @@ store.register_lints(&[
417418
ranges::RANGE_PLUS_ONE,
418419
ranges::RANGE_ZIP_WITH_LEN,
419420
ranges::REVERSED_EMPTY_RANGES,
420-
recursive_format_impl::RECURSIVE_FORMAT_IMPL,
421421
redundant_clone::REDUNDANT_CLONE,
422422
redundant_closure_call::REDUNDANT_CLOSURE_CALL,
423423
redundant_else::REDUNDANT_ELSE,

clippy_lints/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ mod float_literal;
226226
mod floating_point_arithmetic;
227227
mod format;
228228
mod format_args;
229+
mod format_impl;
229230
mod formatting;
230231
mod from_over_into;
231232
mod from_str_radix_10;
@@ -333,7 +334,6 @@ mod ptr_eq;
333334
mod ptr_offset_with_cast;
334335
mod question_mark;
335336
mod ranges;
336-
mod recursive_format_impl;
337337
mod redundant_clone;
338338
mod redundant_closure_call;
339339
mod redundant_else;
@@ -705,7 +705,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
705705
store.register_late_pass(|| Box::new(modulo_arithmetic::ModuloArithmetic));
706706
store.register_early_pass(|| Box::new(reference::DerefAddrOf));
707707
store.register_early_pass(|| Box::new(double_parens::DoubleParens));
708-
store.register_late_pass(|| Box::new(recursive_format_impl::RecursiveFormatImpl::new()));
708+
store.register_late_pass(|| Box::new(format_impl::FormatImpl::new()));
709709
store.register_early_pass(|| Box::new(unsafe_removed_from_name::UnsafeNameRemoval));
710710
store.register_early_pass(|| Box::new(else_if_without_else::ElseIfWithoutElse));
711711
store.register_early_pass(|| Box::new(int_plus_one::IntPlusOne));

0 commit comments

Comments
 (0)