Ruta graveolens  ·  notes from a language experiment  ·  cultivated since 2025

E0009: Malformed byte literal

CodeCategoryStability
E0009LexerPermanent

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'
}

References