{"record":{"id":"c6a34a2f60b55ce0","repo":"GraphiteEditor/Graphite","slug":"failed-to-parse-implementations-for-argument-nam","errorCode":null,"errorMessage":"Failed to parse implementations for argument '{name}': {e}","messagePattern":"Failed to parse implementations for argument '(.+?)': (.+?)","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"node-graph/node-macro/src/parsing.rs","lineNumber":737,"sourceCode":"\t\t\t\t\t\t}\n\t\t\t\t\t\t// Skip Modify* traits as they don't affect usage tracking\n\t\t\t\t\t\t// Also ignore other traits like Ctx, ExtractAll, etc.\n\t\t\t\t\t\t_ => {}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfeatures\n}\n\nfn parse_implementations(attr: &Attribute, name: &Ident) -> syn::Result<Punctuated<Type, Comma>> {\n\tlet content: TokenStream2 = attr.parse_args()?;\n\tlet parser = Punctuated::<Type, Comma>::parse_terminated;\n\tparser.parse2(content.clone()).map_err(|e| {\n\t\tlet span = e.span(); // Get the span of the error\n\t\tError::new(span, format!(\"Failed to parse implementations for argument '{name}': {e}\"))\n\t})\n}\n\nfn parse_node_implementations<T: Parse>(attr: &Attribute, name: &Ident) -> syn::Result<Punctuated<T, Comma>> {\n\tlet content: TokenStream2 = attr.parse_args()?;\n\tlet parser = Punctuated::<T, Comma>::parse_terminated;\n\tparser.parse2(content.clone()).map_err(|e| {\n\t\tError::new(\n\t\t\te.span(),\n\t\t\tformatdoc!(\n\t\t\t\t\"Invalid #[implementations(...)] for argument `{}`.\n\t\t\t\tExpected a comma-separated list of `InputType -> OutputType` pairs.\n\t\t\t\tExample: #[implementations(i32 -> f64, String -> Vec<u8>)]\n\t\t\t\tError: {}\",\n\t\t\t\tname,\n\t\t\t\te\n\t\t\t),\n\t\t)","sourceCodeStart":719,"sourceCodeEnd":755,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/node-graph/node-macro/src/parsing.rs#L719-L755","documentation":"parse_implementations parses an #[implementations(...)] attribute on a plain (non-node) field as a comma-terminated list of bare Rust types (Punctuated<Type, Comma>). When the tokens are not bare types, the syn error is wrapped with the offending argument's identifier so you can find the right parameter.","triggerScenarios":"Using node-style pairs where bare types are expected: #[implementations(f64 -> f64)] on a regular field; passing literals or strings; stray tokens left after the last type in the list.","commonSituations":"Copy-pasting an #[implementations(...)] attribute from a node function parameter onto a plain helper struct field (or vice versa); confusion between the two implementations grammars supported by this codebase.","solutions":["Use bare, comma-separated types here: #[implementations(f32, f64)]","If node-style pairs were intended, that attribute belongs on a node function's parameter parsed by parse_node_implementations instead","Use the argument name in the message to locate which parameter's attribute is malformed"],"exampleFix":"// before: pairs on a plain (non-node) field\n#[implementations(f64 -> f64)]\n\n// after: bare types\n#[implementations(f32, f64)]","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the two grammars straight: bare types on plain fields, Type -> Type pairs on node parameters","When copy-pasting implementations attributes, check which parser consumes the target","Use the argument name in the error to jump to the offending parameter"],"tags":["proc-macro","rust","node-graph","compile-time"],"backgroundTag":"proc-macro-syntax-error","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}