error invalid-char
Недопустимый символ в тексте программы.
What it means#
The lexer met a character that cannot start any token: it is not whitespace, not part of an identifier (§1.3), not a literal (§1.5), and not one of the operators and delimiters listed in §1.6. Stray symbols such as $ or a control character are typical causes.
Example#
fn main() {
let price = $5 // <- invalid-char
}error
invalid-char
How to fix#
fn main() {
let price = 5
}Remove the character or replace it with the intended operator, identifier or literal. A keyword can be used as an identifier through the r# prefix (§1.3), but $ cannot.