@@ -7,9 +7,7 @@ use rustc_ast::ast::{self, AttrStyle};
7
7
use rustc_ast:: token:: { self , CommentKind , Delimiter , Token , TokenKind } ;
8
8
use rustc_ast:: tokenstream:: TokenStream ;
9
9
use rustc_ast:: util:: unicode:: contains_text_flow_control_chars;
10
- use rustc_errors:: {
11
- error_code, Applicability , DiagCtxt , Diagnostic , DiagnosticBuilder , FatalAbort , StashKey ,
12
- } ;
10
+ use rustc_errors:: { error_code, Applicability , DiagCtxt , Diagnostic , StashKey } ;
13
11
use rustc_lexer:: unescape:: { self , EscapeError , Mode } ;
14
12
use rustc_lexer:: { Base , DocStyle , RawStrError } ;
15
13
use rustc_lexer:: { Cursor , LiteralKind } ;
@@ -344,18 +342,6 @@ impl<'a> StringReader<'a> {
344
342
token:: Ident ( sym, false )
345
343
}
346
344
347
- fn struct_fatal_span_char (
348
- & self ,
349
- from_pos : BytePos ,
350
- to_pos : BytePos ,
351
- m : & str ,
352
- c : char ,
353
- ) -> DiagnosticBuilder < ' a , FatalAbort > {
354
- self . sess
355
- . dcx
356
- . struct_span_fatal ( self . mk_sp ( from_pos, to_pos) , format ! ( "{}: {}" , m, escaped_char( c) ) )
357
- }
358
-
359
345
/// Detect usages of Unicode codepoints changing the direction of the text on screen and loudly
360
346
/// complain about it.
361
347
fn lint_unicode_text_flow ( & self , start : BytePos ) {
@@ -568,13 +554,16 @@ impl<'a> StringReader<'a> {
568
554
}
569
555
570
556
fn report_non_started_raw_string ( & self , start : BytePos , bad_char : char ) -> ! {
571
- self . struct_fatal_span_char (
572
- start,
573
- self . pos ,
574
- "found invalid character; only `#` is allowed in raw string delimitation" ,
575
- bad_char,
576
- )
577
- . emit ( )
557
+ self . sess
558
+ . dcx
559
+ . struct_span_fatal (
560
+ self . mk_sp ( start, self . pos ) ,
561
+ format ! (
562
+ "found invalid character; only `#` is allowed in raw string delimitation: {}" ,
563
+ escaped_char( bad_char)
564
+ ) ,
565
+ )
566
+ . emit ( )
578
567
}
579
568
580
569
fn report_unterminated_raw_string (
0 commit comments