E0009: Malformed byte literal
| Code | Category | Stability |
|---|---|---|
E0009 | Lexer | Permanent |
Explanation
A byte literal does not contain exactly one ASCII byte or one supported escape sequence between its single quotes.
Likely cause
The literal is empty, contains multiple or non-ASCII characters, uses an unknown escape, or reaches a line ending or end-of-file before its closing single quote.
Examples
More than one byte
fn main() {
let value = b'ab';
}
Write one byte
fn main() -> i32 {
b'a'
}