本頁尚未翻譯,以下為英文原文。
#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.
Found a mistake? Edit this page on GitHub. Last updated