GraphiteEditor/Graphite · error · syn::Error

Failed to parse output type for #[implementation(...)]. Expe

Error message

Failed to parse output type for #[implementation(...)]. Expected a valid Rust type after `->`.
Error: {}

What it means

The mirror of the input-type error: the tokens after `->` failed to parse as a valid Rust type. The output side of the pair is missing entirely or is not valid type syntax.

Source

Thrown at node-graph/node-macro/src/parsing.rs:374

				input.span(),
				formatdoc!(
					"Failed to parse input type for #[implementation(...)]. Expected a valid Rust type.
					Error: {}",
					e,
				),
			)
		})?;
		let arrow: RArrow = input.parse().map_err(|_| {
			Error::new(
				input.span(),
				indoc!(
					"Expected `->` arrow after input type in #[implementations(...)] on a field of type `impl Node`.
					The correct syntax is `InputType -> OutputType`."
				),
			)
		})?;
		let output_type: Type = input.parse().map_err(|e| {
			Error::new(
				input.span(),
				formatdoc!(
					"Failed to parse output type for #[implementation(...)]. Expected a valid Rust type after `->`.
					Error: {}",
					e
				),
			)
		})?;

		Ok(Implementation {
			input: input_type,
			_arrow: arrow,
			output: output_type,
		})
	}
}

impl Parse for NodeFnAttributes {

View on GitHub (pinned to c507b35645)

Solutions

  1. Complete the pair with a valid type: #[implementations(f64 -> f64)]
  2. Balance all angle brackets in nested generics (e.g. Vec<Vec<f64>>)
  3. Use the appended syn error text to locate the offending token

Example fix

// before
#[implementations(f64 -> )]

// after
#[implementations(f64 -> f64)]
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: #[implementations(f64 -> )] (empty output); #[implementations(f64 -> 3)] (a literal instead of a type); unbalanced angle brackets after the arrow such as #[implementations(f64 -> Vec<)].

Common situations: Truncating an entry while editing a long implementations list; copy-paste that drops the final token; deeply nested generics with unbalanced brackets.

Understand the failure class

Related errors


AI-assisted analysis of GraphiteEditor/Graphite@c507b35645 (2026-08-16). Data as JSON: /api/errors/aa217bff142abb35. Report an issue: GitHub.