GraphiteEditor/Graphite · error · syn::Error

Expected `->` arrow after input type in #[implementations(..

Error message

Expected `->` arrow after input type in #[implementations(...)] on a field of type `impl Node`.
The correct syntax is `InputType -> OutputType`.

What it means

After the input type parses, the Implementation parser demands an RArrow token before the output type. This error fires when `->` is missing between the two types — the tokens following a successfully parsed input type are not an arrow.

Source

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

	pub(crate) ty: Type,
	pub(crate) implementations: Punctuated<Type, Comma>,
	pub(crate) context_features: Vec<Ident>,
}

impl Parse for Implementation {
	fn parse(input: ParseStream) -> syn::Result<Self> {
		let input_type: Type = input.parse().map_err(|e| {
			Error::new(
				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
				),
			)
		})?;

View on GitHub (pinned to c507b35645)

Solutions

  1. Insert the arrow: #[implementations(f64 -> f64)]
  2. For multiple entries keep the shape `A -> B, C -> D`
  3. Re-check the example embedded in the message: #[implementations(i32 -> f64, String -> Vec<u8>)]

Example fix

// before
#[implementations(f64 f64)]

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

Strategy: validation

Prevention

When it happens

Trigger: #[implementations(f64 f64)] (space instead of arrow); #[implementations(String)] (a single bare type with no pair); a comma where the arrow belongs.

Common situations: Migrating from an older single-type implementations syntax to the InputType -> OutputType pair grammar; hand-editing attributes and dropping the arrow mid-list.

Related errors


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