E0758: include_str!("./error_codes/E0758.md"),
E0760: include_str!("./error_codes/E0760.md"),
E0761: include_str!("./error_codes/E0761.md"),
+E0762: include_str!("./error_codes/E0762.md"),
;
// E0006, // merged with E0005
// E0008, // cannot bind by-move into a pattern guard
--- /dev/null
+A character literal wasn't ended with a quote.
+
+Erroneous code example:
+
+```compile_fail,E0762
+static C: char = '●; // error!
+```
+
+To fix this error, add the missing quote:
+
+```
+static C: char = '●'; // ok!
+```
let (lit_kind, mode, prefix_len, postfix_len) = match kind {
rustc_lexer::LiteralKind::Char { terminated } => {
if !terminated {
- self.fatal_span_(start, suffix_start, "unterminated character literal").raise()
+ self.sess
+ .span_diagnostic
+ .struct_span_fatal_with_code(
+ self.mk_sp(start, suffix_start),
+ "unterminated character literal",
+ error_code!(E0762),
+ )
+ .emit();
+ FatalError.raise();
}
(token::Char, Mode::Char, 1, 1) // ' '
}