docs

You are reading the docs for v0.1.2. Nabi 0.1.2 is no longer supported. Latest release: v0.1.3 →

#E0118: invalid meta template

A meta block's template uses a @ token wrongly: an unknown token, one outside the @for_fields or @for_variants it needs, or one without its (..) or { .. }. Write it as the message says.

nabi
#[impl_derive(Names)] @derive {
    impl @Self {
        fn names() -> str { @fild }
    }
}
#[derive(Names)]
struct P { x: i32; }
error[E0118]: unknown template token `@fild`
  --> main.nabi:3:29
   |
 3 |         fn names() -> str { @fild }
   |                             ^
 ...
 6 | #[derive(Names)]
   | -- in this `#[derive(Names)]`

Spell the token as listed in 6.9 Template tokens: here @field, inside a @for_fields { .. } block.

Related: E0119 invalid meta block, E0116 malformed macro definition

Found a mistake? Edit this page on GitHub. Last updated