File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,7 @@ E0761: include_str!("./error_codes/E0761.md"),
445445E0762 : include_str!( "./error_codes/E0762.md" ) ,
446446E0763 : include_str!( "./error_codes/E0763.md" ) ,
447447E0764 : include_str!( "./error_codes/E0764.md" ) ,
448+ E0765 : include_str!( "./error_codes/E0765.md" ) ,
448449;
449450// E0006, // merged with E0005
450451// E0008, // cannot bind by-move into a pattern guard
Original file line number Diff line number Diff line change 1+ A double quote string (` " ` ) was not terminated.
2+
3+ Erroneous code example:
4+
5+ ``` compile_fail,E0765
6+ let s = "; // error!
7+ ```
8+
9+ To fix this error, add the missing double quote at the end of the string:
10+
11+ ```
12+ let s = ""; // ok!
13+ ```
Original file line number Diff line number Diff line change @@ -353,8 +353,15 @@ impl<'a> StringReader<'a> {
353353 }
354354 rustc_lexer:: LiteralKind :: Str { terminated } => {
355355 if !terminated {
356- self . fatal_span_ ( start, suffix_start, "unterminated double quote string" )
357- . raise ( )
356+ self . sess
357+ . span_diagnostic
358+ . struct_span_fatal_with_code (
359+ self . mk_sp ( start, suffix_start) ,
360+ "unterminated double quote string" ,
361+ error_code ! ( E0765 ) ,
362+ )
363+ . emit ( ) ;
364+ FatalError . raise ( ) ;
358365 }
359366 ( token:: Str , Mode :: Str , 1 , 1 ) // " "
360367 }
You can’t perform that action at this time.
0 commit comments