Add E0747 error code

This commit is contained in:
Guillaume Gomez 2020-02-18 14:50:27 +01:00
parent e2223c94bf
commit bae5f3976b
2 changed files with 7 additions and 2 deletions

View File

@ -418,6 +418,7 @@ E0744: include_str!("./error_codes/E0744.md"),
E0745: include_str!("./error_codes/E0745.md"),
E0746: include_str!("./error_codes/E0746.md"),
E0747: include_str!("./error_codes/E0747.md"),
E0748: include_str!("./error_codes/E0748.md"),
;
// E0006, // merged with E0005
// E0008, // cannot bind by-move into a pattern guard

View File

@ -1,5 +1,5 @@
use rustc_data_structures::sync::Lrc;
use rustc_errors::{DiagnosticBuilder, FatalError};
use rustc_errors::{error_code, DiagnosticBuilder, FatalError};
use rustc_lexer::unescape;
use rustc_lexer::Base;
use rustc_session::parse::ParseSess;
@ -495,7 +495,11 @@ impl<'a> StringReader<'a> {
}
fn report_unterminated_raw_string(&self, start: BytePos, n_hashes: usize) -> ! {
let mut err = self.struct_span_fatal(start, start, "unterminated raw string");
let mut err = self.sess.span_diagnostic.struct_span_fatal_with_code(
self.mk_sp(start, start),
"unterminated raw string",
error_code!(E0748),
);
err.span_label(self.mk_sp(start, start), "unterminated raw string");
if n_hashes > 0 {