{"record":{"id":"f776798890e66d18","repo":"leptos-rs/leptos","slug":"keyword-argument-repeated-impl-from","errorCode":null,"errorMessage":"keyword argument repeated: `impl_from`","messagePattern":"keyword argument repeated: `impl_from`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server_fn_macro/src/lib.rs","lineNumber":1165,"sourceCode":"                    } else if key == \"server\" {\n                        if server.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `server`\",\n                            ));\n                        }\n                        server = Some(stream.parse()?);\n                    } else if key == \"client\" {\n                        if client.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `client`\",\n                            ));\n                        }\n                        client = Some(stream.parse()?);\n                    } else if key == \"custom\" {\n                        if custom_wrapper.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `custom`\",\n                            ));\n                        }\n                        custom_wrapper = Some(stream.parse()?);\n                    } else if key == \"impl_from\" {\n                        if impl_from.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `impl_from`\",\n                            ));\n                        }\n                        impl_from = Some(stream.parse()?);\n                    } else if key == \"impl_deref\" {\n                        if impl_deref.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `impl_deref`\",","sourceCodeStart":1147,"sourceCodeEnd":1183,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/server_fn_macro/src/lib.rs#L1147-L1183","documentation":"This error is raised when the `impl_from` keyword argument appears more than once in a #[server] attribute. `impl_from` is a boolean flag that generates From impls; repeating it is ambiguous (or contradictory if the values differ), so the parser fails compilation with a span on the repeated key.","triggerScenarios":"Writing #[server(impl_from = true, impl_from = false)] or any other duplicate of `impl_from`, often from a macro wrapper adding the flag on top of a user-supplied value.","commonSituations":"Copy-paste of attribute lines, macro_rules! wrappers that unconditionally append impl_from, refactoring flag values without deleting the old entry.","solutions":["Keep a single `impl_from = ...` entry.","Remove the flag entirely to accept the default behavior.","Make wrapper macros append `impl_from` only when the caller did not specify it."],"exampleFix":"// before\n#[server(impl_from = true, impl_from = false)]\nasync fn save(data: String) -> Result<(), ServerFnError> { todo!() }\n\n// after\n#[server(impl_from = true)]\nasync fn save(data: String) -> Result<(), ServerFnError> { todo!() }","handlingStrategy":"validation","validationCode":"// Pre-commit check for duplicate `impl_from` args:\n// grep -rnE '#\\[server\\([^)\\n]*impl_from\\s*=[^)\\n]*impl_from\\s*=' src/ && exit 1 || exit 0","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare `impl_from` at most once per attribute.","Toggle the value instead of adding a second flag entry.","Ensure macro wrappers do not append impl_from over user-supplied values.","Include cargo check in CI to catch attribute parse errors."],"tags":["rust","proc-macro","compile-time","server-fn"],"backgroundTag":"duplicate-macro-attribute-argument","analyzedSha":"32d20f6c9d517451d77beb68d88c7716823dac41","analyzedAt":"2026-09-01T18:55:42.580Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}