File tree 2 files changed +22
-2
lines changed
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
518
518
equivalent in Rust would be to use macros directly.
519
519
"## ,
520
520
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
+
521
539
;
522
540
523
541
E0539 , // incorrect meta item
Original file line number Diff line number Diff line change @@ -501,8 +501,10 @@ impl<'a> StringReader<'a> {
501
501
}
502
502
503
503
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 ,
506
508
"unterminated raw string" ,
507
509
) ;
508
510
err. span_label (
You can’t perform that action at this time.
0 commit comments