Sisu
E0089

Unknown escape

Error

Built from the repository at commit a8614dc.

After a \ a char or string literal takes one of \n, \t, \r, \0, \\, \", \', \{, \} or \u{...}. Any other character after the \ is an error, reported over the \ and that character.

Why

An escape that Sisu does not know has no value. Choosing one would put a character in the program that the writer may not have meant, and there is no \xNN byte escape: a lone byte could break the UTF-8 that text must be. In a string literal the most likely mistake is a backslash meant as itself, so the report offers \\ as an unsafe fix, which you check before you apply it. In a char literal a second backslash would make two code points, so none is offered.

Broken

fn main() {
    let c = '\q'
    print(c)
}

What sisu says

error[E0089]: unknown escape `\q`
 --> E0089.sisu:2:14
  |
2 |     let c = '\q'
  |              ^^
  |
  = help: the escapes are `\n`, `\t`, `\r`, `\0`, `\\`, `\"`, `\'`, `\{`, `\}` and `\u{...}`

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

Fixed

fn main() {
    let c = '\t'
    print(c)
}