docs

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

#E0111: invalid #[lang] item

#[lang("slot")] (standard library only) names a known slot, once, on an item of the slot's form.

nabi
#[lang("add_trait")]
trait BadAdd { fn plus(self, o: Self) -> Self; }
error[E0111]: `BadAdd` does not match the form of lang slot `add_trait`: it needs `fn add(self, _)`
  --> main.nabi:1:1
   |
 1 | #[lang("add_trait")]
   | ^^

#[lang] is for the standard library. A program implements the standard trait instead: impl ops::Add for Point gives Point the + operator.

Related: E0115 invalid #[intrinsic], E0123 registered twice

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