S0145: extern function declaration cannot have a body
Generated from rellum-diagnostics/src/db.rs.
Explanation
Functions declared inside an extern block are imported declarations. Their implementation lives outside the Rellum module, so the declaration provides only a signature and no = expr body.
Common causes
- adding
= ...after an extern function signature - moving a normal Rellum function declaration into an extern block without removing its body
Canonical fixes
- remove the function body from the extern declaration
Before:
extern "C" { fn strlen(s: Ptr[RawByte]) : Int = 0 }
After:
extern "C" { fn strlen(s: Ptr[RawByte]) : Int }
Code example
extern "C" { fn strlen(s: Ptr[RawByte]) : Int = 0 }