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
- Insert the arrow: #[implementations(f64 -> f64)]
- For multiple entries keep the shape `A -> B, C -> D`
- 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
- Always write both sides of every pair, joined by ->
- When migrating old nodes, rewrite bare-type lists as pairs in the same commit
- Let rustfmt/rust-analyzer format the attribute so missing arrows are easier to spot
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
- Failed to parse input type for #[implementation(...)]. Expec
- Failed to parse output type for #[implementation(...)]. Expe
- Failed to parse node_fn attributes: {e}
- Failed to parse implementations for argument '{name}': {e}
- Invalid #[implementations(...)] for argument `{}`. Expected
AI-assisted analysis of GraphiteEditor/Graphite@c507b35645 (2026-08-16).
Data as JSON: /api/errors/2f6ee45877152118.
Report an issue: GitHub.