At the top level of a file only items are allowed: fn, struct, enum, shape, test,
let and imprint. Statements belong inside a function, and Auk has no import: anything is
reached by its path.
Wrong#
print("hello")Fixed#
fn main() {
print("hello")
}Common causes#
- Script-style code at the top level: put it in
fn main(). import jsonoruse std::fs: delete it and writejson.parse(s)directly.- A stray token after an item, such as an extra
}.