-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-UnicodeArea: UnicodeArea: UnicodeA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-lowLow priorityLow priority
Description
It would be nice if b"foo" could be used instead of str::as_bytes_slice("foo"), and especially ~b"bar" instead of vec::from_slice(str::as_bytes_slice("bar")). Python uses this convention and only allows ASCII inside the byte string literals (along with byte escape codes). I don't really think it's necessary to forbid Unicode though - Python does that to make a very clear distinction between bytes and strings.
There could also be a byte version of a char literal, allowing any ASCII character (b'\n') - a 55u8 literal removes the need for escape codes there.
Metadata
Metadata
Assignees
Labels
A-UnicodeArea: UnicodeArea: UnicodeA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-lowLow priorityLow priority