-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Summary
I have an enum representing possible errors from deserialization:
pub enum PromotionError {
NoPromotionId,
InvalidPromotionId(String),
InvalidProductId(String),
}clippy produces this: warning: all variants have the same postfix: Id and "helpfully" suggests: help: remove the postfixes and use full paths to the variants instead of glob imports
Maybe it's just me but the suggestion here seems completely irrelevant. I'm not even sure what the lint is trying to catch: what's the stylistic concern here?
Lint Name
enum_variant_names
Reproducer
I tried this code:
pub enum PromotionError {
NoPromotionId,
InvalidPromotionId(String),
InvalidProductId(String),
}I saw this happen:
[<output>](warning: all variants have the same postfix: Id)
I expected to see this happen:
No error.
Version
rustc 1.68.1 (8460ca823 2023-03-20)
binary: rustc
commit-hash: 8460ca823e8367a30dda430efda790588b8c84d3
commit-date: 2023-03-20
host: x86_64-unknown-linux-gnu
release: 1.68.1
LLVM version: 15.0.6
Additional Labels
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have