{"record":{"id":"6b7877c710a73079","repo":"astral-sh/ruff","slug":"this-variant-already-has-another-prefix-starting-w","errorCode":null,"errorMessage":"this variant already has another prefix starting with the character '{c}'","messagePattern":"this variant already has another prefix starting with the character '(.+?)'","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/ruff_macros/src/rule_namespace.rs","lineNumber":60,"sourceCode":"                    ..\n                }) = &attr.meta\n                else {\n                    return Err(Error::new(\n                        attr.span(),\n                        r#\"expected attribute to be in the form of [#prefix = \"...\"]\"#,\n                    ));\n                };\n                let str = lit.value();\n                match str.chars().next() {\n                    None => {\n                        return Err(Error::new(\n                            lit.span(),\n                            \"expected prefix string to be non-empty\",\n                        ));\n                    }\n                    Some(c) => {\n                        if !first_chars.insert(c) {\n                            return Err(Error::new(\n                                lit.span(),\n                                format!(\n                                    \"this variant already has another prefix \\\n                                    starting with the character '{c}'\"\n                                ),\n                            ));\n                        }\n                    }\n                }\n                if !all_prefixes.insert(str.clone()) {\n                    return Err(Error::new(\n                        lit.span(),\n                        \"prefix has already been defined before\",\n                    ));\n                }\n                Ok(str)\n            })\n            .collect();","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ruff_macros/src/rule_namespace.rs#L42-L78","documentation":"A syn compile error from the RuleNamespace derive: two #[prefix] attributes on the same variant start with the same character. Rule codes are dispatched by first character, so duplicate leading characters within a variant would be ambiguous.","triggerScenarios":"Thrown at crates/ruff_macros/src/rule_namespace.rs:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give the variant prefixes distinct first characters","Remove one of the conflicting prefixes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26f38c119cac42e4d320ba08f09224fdec74af2c","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}