Skip to main content

E0038: Emit, raise, or runtime keyword not needed

You used the emit, raise, or runtime keyword to call a function that does not need it.

Example

fn regular_function() -> i64 {
42
}

fn main() {
let x = runtime regular_function(); // Error: `runtime` can only be used with runtime function calls
}

How to fix

Remove the keyword:

fn regular_function() -> i64 {
42
}

fn main() {
let x = regular_function(); // OK - no runtime keyword needed
}