Skip to content

Commit 6511d2f

Browse files
rename lint
1 parent 6e2ab0c commit 6511d2f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

clippy_lints/src/error_impl_error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_span::sym;
1010

1111
declare_clippy_lint! {
1212
/// ### What it does
13-
/// Checks for types named `Error` that implement `Error`.
13+
/// Checks for types named `*Error` that implement `Error`.
1414
///
1515
/// ### Why restrict this?
1616
/// It can become confusing when a codebase has 20 types all named `Error`, requiring either

clippy_lints/src/missing_error_impl.rs clippy_lints/src/missing_error_implementations.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ declare_clippy_lint! {
3131
/// impl core::error::Error for ParseError { ... }
3232
/// ```
3333
#[clippy::version = "1.87.0"]
34-
pub MISSING_ERROR_IMPL,
34+
pub MISSING_ERROR_IMPLEMENTATIONS,
3535
suspicious,
3636
"exported types with potentially forgotten `Error` implementation"
3737
}
3838

39-
declare_lint_pass!(MissingErrorImpl => [MISSING_ERROR_IMPL]);
39+
declare_lint_pass!(MissingErrorImplementations => [MISSING_ERROR_IMPLEMENTATIONS]);
4040

41-
impl<'tcx> LateLintPass<'tcx> for MissingErrorImpl {
41+
impl<'tcx> LateLintPass<'tcx> for MissingErrorImplementations {
4242
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
4343
match item.kind {
4444
ItemKind::Enum(_, generics) | ItemKind::Struct(_, generics) => {
@@ -59,7 +59,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingErrorImpl {
5959
{
6060
span_lint(
6161
cx,
62-
MISSING_ERROR_IMPL,
62+
MISSING_ERROR_IMPLEMENTATIONS,
6363
item.ident.span,
6464
"error type doesn't implement `Error`",
6565
);

tests/ui/missing_error_impl.rs tests/ui/missing_error_implementations.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#![warn(clippy::missing_error_impl)]
1+
#![warn(clippy::missing_error_implementations)]
22

33
struct InternalError;
44

55
pub(crate) struct CrateInternalError;
66

77
pub struct PublicError;
8-
//~^ missing_error_impl
8+
//~^ missing_error_implementations
99

1010
pub struct NotAnErrorType;
1111

Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: error type doesn't implement `Error`
2-
--> tests/ui/missing_error_impl.rs:7:12
2+
--> tests/ui/missing_error_implementations.rs:7:12
33
|
44
LL | pub struct PublicError;
55
| ^^^^^^^^^^^
66
|
7-
= note: `-D clippy::missing-error-impl` implied by `-D warnings`
8-
= help: to override `-D warnings` add `#[allow(clippy::missing_error_impl)]`
7+
= note: `-D clippy::missing-error-implementations` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::missing_error_implementations)]`
99

1010
error: aborting due to 1 previous error
1111

0 commit comments

Comments
 (0)