diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-06-12 14:01:47 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-06-16 13:14:04 +0200 |
| commit | a19dfb573d18c8b937c159cda24a3bb40ca5082d (patch) | |
| tree | 63f57eb00488e479d5fe3c7edaa83007262148f1 /src/librustc_parse | |
| parent | 59493917be3e87e1dfb44a9ccb66a9f9b17228e6 (diff) | |
Create new E0763 error code for unterminated byte constant
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 84b3335a0f6..2e3cf4e746a 100644 --- a/src/librustc_parse/lexer/mod.rs +++ b/src/librustc_parse/lexer/mod.rs @@ -339,8 +339,15 @@ impl<'a> StringReader<'a> { } rustc_lexer::LiteralKind::Byte { terminated } => { if !terminated { - self.fatal_span_(start + BytePos(1), suffix_start, "unterminated byte constant") - .raise() + self.sess + .span_diagnostic + .struct_span_fatal_with_code( + self.mk_sp(start + BytePos(1), suffix_start), + "unterminated byte constant", + error_code!(E0763), + ) + .emit(); + FatalError.raise(); } (token::Byte, Mode::Byte, 2, 1) // b' ' } |
