本頁尚未翻譯,以下為英文原文。
#E0115: invalid #[intrinsic]
#[intrinsic("nabi.OP.TYPE")] is for the standard library, on a function of the shape the operation takes.
nabi
#[intrinsic("nabi.add.i32")]
fn add(a: i32, b: i32) -> i32 { a + b }
error[E0115]: `#[intrinsic]` on `add`: the intrinsic attribute is for the standard library only --> main.nabi:2:1 | 2 | fn add(a: i32, b: i32) -> i32 { a + b } | ^^
Remove the attribute and write the body in Nabi; the compiler optimizes plain arithmetic on its own.
Related: E0111 invalid #[lang] item
Found a mistake? Edit this page on GitHub. Last updated