Error codes

E0418: raw is only for the runtime

In a terminal: auk explain E0418 prints this page.

On this page

raw is the low-level dialect the Auk runtime is written in (docs/lowlevel.md): raw pointers, C layouts, mutable globals, export fn. Only the runtime package (runtime/raft.toml, name = "auk_rt") may use it: the raw effect, raw struct, raw var, export fn and the fixed-width types are errors anywhere else.

Wrong#

auk
fn peek_byte() uses raw {}

Fixed#

auk
fn peek_byte() {}

Common causes#

  • Reaching for raw memory in ordinary code: bind C functions with extern fn in a package with the ffi effect instead (C pointers are ffi.Ptr).
  • Listing raw in a package's raft.toml effects: only the runtime package may.
  • Code copied from the runtime into another package.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page