{"record":{"id":"590801661536703c","repo":"rust-lang/rust","slug":"no-attributes-expected","errorCode":null,"errorMessage":"no attributes expected","messagePattern":"no attributes expected","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"library/compiler-builtins/crates/libm-macros/src/enums.rs","lineNumber":110,"sourceCode":"                match self {\n                    #( #base_arms, )*\n                }\n            }\n        }\n    };\n\n    Ok(res)\n}\n\n/// Implement `#[base_name_enum]`, see documentation in `lib.rs`.\npub fn base_name_enum(\n    mut item: ItemEnum,\n    attributes: pm2::TokenStream,\n) -> syn::Result<pm2::TokenStream> {\n    expect_empty_enum(&item)?;\n    if !attributes.is_empty() {\n        let sp = attributes.span();\n        return Err(syn::Error::new(sp.span(), \"no attributes expected\"));\n    }\n\n    let mut base_names: Vec<_> = ALL_OPERATIONS\n        .iter()\n        .map(|func| base_name(func.name))\n        .collect();\n    base_names.sort_unstable();\n    base_names.dedup();\n\n    let item_name = &item.ident;\n    let mut as_str_arms = Vec::new();\n\n    for base_name in base_names {\n        let ident = Ident::new(&base_name.to_upper_camel_case(), Span::call_site());\n\n        // Match arm for `fn as_str(self)` matcher\n        as_str_arms.push(quote! { Self::#ident => #base_name });\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/library/compiler-builtins/crates/libm-macros/src/enums.rs#L92-L128","documentation":"Thrown by the `#[base_name_enum]` attribute macro (enums.rs:110) when any attribute argument is provided. Unlike `function_enum`, this macro takes no arguments because it derives its variants from the global operation list.","triggerScenarios":"Writing `#[base_name_enum(SomeArg)]` or any form with tokens between the parentheses.","commonSituations":"Confusing `base_name_enum` with `function_enum` (which does take an argument); copy-pasting an attribute shape from the other macro.","solutions":["Use `#[base_name_enum]` with empty parentheses (or none).","Remember: base_name_enum takes no attributes; function_enum takes one."],"exampleFix":"// before\n#[base_name_enum(Some)]\nenum Bn {}\n\n// after\n#[base_name_enum]\nenum Bn {}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["base_name_enum accepts zero attributes.","Do not confuse it with function_enum, which requires one."],"tags":["proc-macro","libm","base-name-enum","validation"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}