Sisu
E0004

{ on a line of its own

ErrorSafe fix

Built from the repository at commit a8614dc.

The { that opens a function, class, enum or block must stand on the same line as its header: fn, class, enum, if, else, match, while, for or loop.

Why

A line break ends a statement, so a { on its own line is a new statement, not the body of the header above. Sisu has one layout, with the { at the end of the header line, so a reader never has to decide where a body starts.

Broken

fn main()
{
    print(1)
}

What sisu says

error[E0004]: `{` must be on the same line as `fn`, `class`, `enum`, `if`, `else`, `match`, `while`, `for` or `loop`
 --> E0004.sisu:2:1
  |
2 | {
  | ^
  |
help: move `{` to the end of the line above
  |
1 | fn main() {
  |          +

sisu: 1 error
sisu: for more on a code, run `sisu explain <code>`: E0004

Fixed

fn main() {
    print(1)
}