diff options
author | Deadbeef <ent3rm4n@gmail.com> | 2023-03-10 14:18:58 +0000 |
---|---|---|
committer | Deadbeef <ent3rm4n@gmail.com> | 2023-05-02 10:32:08 +0000 |
commit | abb181dfd9b9df22908ab08d7cfb46509295e2e6 (patch) | |
tree | 3872f7b6250f2b217082481899f4de183d12a3c7 /compiler/rustc_parse | |
parent | bf3ca5979e47774802e95623c11e71fb303e5ff3 (diff) | |
download | rust-abb181dfd9b9df22908ab08d7cfb46509295e2e6.tar.gz |
make it semantic error
Diffstat (limited to 'compiler/rustc_parse')
-rw-r--r-- | compiler/rustc_parse/src/lexer/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index b2050780309..050f1898615 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -204,6 +204,9 @@ impl<'a> StringReader<'a> { rustc_lexer::TokenKind::Literal { kind, suffix_start } => { let suffix_start = start + BytePos(suffix_start); let (kind, symbol) = self.cook_lexer_literal(start, suffix_start, kind); + if let token::LitKind::CStr | token::LitKind::CStrRaw(_) = kind { + self.sess.gated_spans.gate(sym::c_str_literals, self.mk_sp(start, self.pos)); + } let suffix = if suffix_start < self.pos { let string = self.str_from(suffix_start); if string == "_" { |