Closed
Description
Summary
When an enum has #[derive(Serialize)]
, it triggers the use_self
lint
Lint Name
use_self
Reproducer
I tried this code:
#![warn(clippy::use_self)]
use serde::Serialize;
#[derive(Serialize)]
pub enum Foo {
Bar = 1,
}
I saw this happen:
warning: unnecessary structure name repetition
--> src/lib.rs:6:10
|
6 | pub enum Foo {
| ^^^ help: use the applicable keyword: `Self`
|
note: the lint level is defined here
--> src/lib.rs:1:9
|
1 | #![warn(clippy::use_self)]
| ^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
warning: `playground` (lib) generated 1 warning
I expected to see this happen:
No warnings
Version
Playground
Additional Labels
No response