Allow duplicate enum values for enum.auto() (#1933)

Closes #1932.
This commit is contained in:
Charlie Marsh
2023-01-17 11:14:11 -05:00
committed by GitHub
parent 30e133f3d8
commit 70ea4b25e8
2 changed files with 16 additions and 1 deletions

View File

@@ -131,6 +131,15 @@ where
continue;
};
if let ExprKind::Call { func, .. } = &value.node {
if checker
.resolve_call_path(func)
.map_or(false, |call_path| call_path == ["enum", "auto"])
{
continue;
}
}
if !seen_targets.insert(ComparableExpr::from(value)) {
let diagnostic = Diagnostic::new(
violations::PreferUniqueEnums {