{"record":{"id":"926406fdb654ec94","repo":"linebender/druid","slug":"expected-attribute-list-the-form-lens-one-two","errorCode":null,"errorMessage":"Expected attribute list (the form #[lens(one, two)])","messagePattern":"Expected attribute list \\(the form #\\[lens\\(one, two\\)\\]\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"druid-derive/src/attr.rs","lineNumber":244,"sourceCode":"                                    }\n                                    ignore = true;\n                                }\n                                NestedMeta::Meta(Meta::NameValue(meta))\n                                    if meta.path.is_ident(LENS_NAME_OVERRIDE_ATTR_PATH) =>\n                                {\n                                    if lens_name_override.is_some() {\n                                        return Err(Error::new(meta.span(), \"Duplicate attribute\"));\n                                    }\n\n                                    let ident = parse_lit_into_ident(&meta.lit)?;\n                                    lens_name_override = Some(ident);\n                                }\n                                other => return Err(Error::new(other.span(), \"Unknown attribute\")),\n                            }\n                        }\n                    }\n                    other => {\n                        return Err(Error::new(\n                            other.span(),\n                            \"Expected attribute list (the form #[lens(one, two)])\",\n                        ));\n                    }\n                }\n            }\n        }\n        Ok(Field {\n            ident,\n            ty,\n            attrs: LensAttrs {\n                ignore,\n                lens_name_override,\n            },\n        })\n    }\n}\n","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/linebender/druid/blob/0f8b1195e4e073f9597f2865299c3d18f8e4005f/druid-derive/src/attr.rs#L226-L262","documentation":"The #[lens(...)] helper attribute must be a meta list of the form #[lens(one, two)]. If it appears as a bare path (#[lens]) or in name-value form (#[lens = \"x\"]), the parser emits this compile-time error describing the expected shape.","triggerScenarios":"Using #[lens] with no arguments on a field, or #[lens = \"value\"], when parse_ast expects a parenthesized attribute list.","commonSituations":"Forgetting parentheses, thinking the bare attribute alone marks the field, syntax carried over from other derive crates.","solutions":["Use the list form: #[lens(ignore)] or #[lens(name = \"...\")].","Remove the attribute entirely if no option is needed.","Consult the derive docs for the exact accepted syntax in your druid version."],"exampleFix":"// before\n#[lens]\ninner: Vec<Widget>,\n// after\n#[lens(ignore)]\ninner: Vec<Widget>,","handlingStrategy":"validation","validationCode":"// Ensure every lens helper attribute uses list form before compiling:\nfn assert_list_form(attr_src: &str) {\n    assert!(attr_src.contains(\"lens(\"), \"#[lens(...)] must use list form: {}\", attr_src);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always give #[lens] a parenthesized argument list.","A bare #[lens] marker is invalid — either add options or delete it.","Never use #[lens = \"...\"] name-value form."],"tags":["derive-macro","proc-macro","compile-time","syntax"],"backgroundTag":"invalid-argument-format","analyzedSha":"0f8b1195e4e073f9597f2865299c3d18f8e4005f","analyzedAt":"2026-09-10T14:27:34.582Z","contentChangedAt":"2026-09-10T14:27:34.582Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}