Sisu
E0096

Empty interpolation

ErrorUnsafe fix

Built from the repository at commit a8614dc.

An interpolation holds an expression. {} in a string literal, braces with only spaces between them, and {:>8}, a format spec with no expression before it, hold none. The error covers the braces.

Why

The compiler cannot tell whether an expression is missing or the braces were meant as text. The fix writes \{\}, the literal braces, which is unsafe: you may have meant to write an expression there.

Broken

fn main() {
    print("{}")
}

What sisu says

error[E0096]: empty interpolation
 --> E0096.sisu:2:12
  |
2 |     print("{}")
  |            ^^
  |
help: write `\{\}` for literal braces
  |
2 |     print("\{\}")
  |            + +

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

Fixed

fn main() {
    print("\{\}")
}