Skip to content
TE210 · Type · error

Syntax category is incompatible with the derive output slot

A structured derive returned syntax that cannot be inserted at its destination; derive results must currently be `Syntax<.Items>` or `Syntax<.Item>`.

Why this fires

A structured derive returned syntax with a category that cannot be inserted at its destination. A derive result must currently be Syntax<.Items> or Syntax<.Item>.

@derive_for(Tag)
fn derive_tag(info) -> Syntax<.Expr> {
  return quote expr { info.name }
}

Fix it

Return an item template, and use narrower categories only for nested holes.

fn derive_tag(info) -> Syntax<.Items> {
  return quote items { impl ${info.ref} {} }
}

See also

Search Zolo

9 results

en