File tree 7 files changed +50
-1
lines changed
7 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -437,6 +437,7 @@ E0751: include_str!("./error_codes/E0751.md"),
437
437
E0752 : include_str!( "./error_codes/E0752.md" ) ,
438
438
E0753 : include_str!( "./error_codes/E0753.md" ) ,
439
439
E0754 : include_str!( "./error_codes/E0754.md" ) ,
440
+ E0758 : include_str!( "./error_codes/E0758.md" ) ,
440
441
;
441
442
// E0006, // merged with E0005
442
443
// E0008, // cannot bind by-move into a pattern guard
Original file line number Diff line number Diff line change
1
+ A multi-line (doc-)comment is unterminated.
2
+
3
+ Erroneous code example:
4
+
5
+ ``` compile_fail,E0758
6
+ /* I am not terminated!
7
+ ```
8
+
9
+ The same goes for doc comments:
10
+
11
+ ``` compile_fail,E0758
12
+ /*! I am not terminated!
13
+ ```
14
+
15
+ You need to end your multi-line comment with ` */ ` in order to fix this error:
16
+
17
+ ```
18
+ /* I am terminated! */
19
+ /*! I am also terminated! */
20
+ ```
Original file line number Diff line number Diff line change @@ -191,7 +191,15 @@ impl<'a> StringReader<'a> {
191
191
"unterminated block comment"
192
192
} ;
193
193
let last_bpos = self . pos ;
194
- self . fatal_span_ ( start, last_bpos, msg) . raise ( ) ;
194
+ self . sess
195
+ . span_diagnostic
196
+ . struct_span_fatal_with_code (
197
+ self . mk_sp ( start, last_bpos) ,
198
+ msg,
199
+ error_code ! ( E0758 ) ,
200
+ )
201
+ . emit ( ) ;
202
+ FatalError . raise ( ) ;
195
203
}
196
204
197
205
if is_doc_comment {
Original file line number Diff line number Diff line change
1
+ /* //~ ERROR E0758
Original file line number Diff line number Diff line change
1
+ error[E0758]: unterminated block comment
2
+ --> $DIR/unterminated-comment.rs:1:1
3
+ |
4
+ LL | /*
5
+ | ^^^^^^^^^^^^^^^^^^^
6
+
7
+ error: aborting due to previous error
8
+
9
+ For more information about this error, try `rustc --explain E0758`.
Original file line number Diff line number Diff line change
1
+ /*! //~ ERROR E0758
Original file line number Diff line number Diff line change
1
+ error[E0758]: unterminated block doc-comment
2
+ --> $DIR/unterminated-doc-comment.rs:1:1
3
+ |
4
+ LL | /*!
5
+ | ^^^^^^^^^^^^^^^^^^^^
6
+
7
+ error: aborting due to previous error
8
+
9
+ For more information about this error, try `rustc --explain E0758`.
You can’t perform that action at this time.
0 commit comments