Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
51b51b51d7931da85280382a81c4dd80c73ca754
rust/tests/ui/lexer/lex-bad-char-literals-7.rs

14 lines
317 B
Rust
Raw Normal View History

introduce unescape module Currently, we deal with escape sequences twice: once when we lex a string, and a second time when we unescape literals. This PR aims to remove this duplication, by introducing a new `unescape` mode as a single source of truth for character escaping rules
2019-04-25 11:48:25 +03:00
fn main() {
let _: char = '';
//~^ ERROR: empty character literal
let _: char = '\u{}';
Handle `Span`s for byte and raw strings and add more detail
2021-01-23 12:48:31 -08:00
//~^ ERROR: empty unicode escape
introduce unescape module Currently, we deal with escape sequences twice: once when we lex a string, and a second time when we unescape literals. This PR aims to remove this duplication, by introducing a new `unescape` mode as a single source of truth for character escaping rules
2019-04-25 11:48:25 +03:00
// Next two are OK, but may befool error recovery
let _ = '/';
let _ = b'/';
let _ = ' hello // here's a comment
//~^ ERROR: unterminated character literal
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2434ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API