diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-06-21 11:24:35 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-06-21 14:09:12 +0200 |
| commit | a657be42b1a7550c071bcccfc66dee22a55a96d1 (patch) | |
| tree | 9406468d4f51257dcb85ea7b43eb573797eae072 /src/librustc_parse | |
| parent | 228a0ed7b0cef2fbfeb781acf6c23015ccc40ba2 (diff) | |
| download | rust-a657be42b1a7550c071bcccfc66dee22a55a96d1.tar.gz rust-a657be42b1a7550c071bcccfc66dee22a55a96d1.zip | |
Create E0765 error for unterminated double quote strings
Diffstat (limited to 'src/librustc_parse')
| -rw-r--r-- | src/librustc_parse/lexer/mod.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/librustc_parse/lexer/mod.rs b/src/librustc_parse/lexer/mod.rs index 2e3cf4e746a..8e74c3847bc 100644 --- a/src/librustc_parse/lexer/mod.rs +++ b/src/librustc_parse/lexer/mod.rs @@ -353,8 +353,15 @@ impl<'a> StringReader<'a> { } rustc_lexer::LiteralKind::Str { terminated } => { if !terminated { - self.fatal_span_(start, suffix_start, "unterminated double quote string") - .raise() + self.sess + .span_diagnostic + .struct_span_fatal_with_code( + self.mk_sp(start, suffix_start), + "unterminated double quote string", + error_code!(E0765), + ) + .emit(); + FatalError.raise(); } (token::Str, Mode::Str, 1, 1) // " " } |
