File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -518,6 +518,24 @@ undefined number of parameters to a given function (like `printf` in C). The
518518equivalent in Rust would be to use macros directly.
519519"## ,
520520
521+ E0744 : r##"
522+ A raw string isn't terminated.
523+
524+ Erroneous code example:
525+
526+ ```compile_fail,E0744
527+ let dolphins = r##"Dolphins!"#; // error!
528+ ```
529+
530+ To terminate a raw string, you have to have the same number of `#` at the end
531+ than at the beginning. Example:
532+
533+ ```
534+ let dolphins = r#"Dolphins!"#; // one `#` at the beginning, one at the end so
535+ // all good!
536+ ```
537+ "## ,
538+
521539;
522540
523541 E0539 , // incorrect meta item
Original file line number Diff line number Diff line change @@ -501,8 +501,10 @@ impl<'a> StringReader<'a> {
501501 }
502502
503503 fn report_unterminated_raw_string ( & self , start : BytePos , n_hashes : usize ) -> ! {
504- let mut err = self . struct_span_fatal (
505- start, start,
504+ let mut err = struct_span_fatal ! (
505+ self . sess. span_diagnostic,
506+ self . mk_sp( start, start) ,
507+ E0744 ,
506508 "unterminated raw string" ,
507509 ) ;
508510 err. span_label (
You can’t perform that action at this time.
0 commit comments