Error codes

E0333: un-awaited async fn call used as its result

In a terminal: auk explain E0333 prints this page.

On this page

An async fn call is a task, not its result. Using it where the result is expected (in arithmetic, as an argument, as a return value) needs an await first.

Wrong#

auk
async fn get(): int = 1
fn main() { print(get() + 1) }

Fixed#

auk
async fn get(): int = 1
fn main() { print(await get() + 1) }

Common causes#

  • A forgotten await.
  • A function that became async after its callers were written.

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