From a03fbfe2ff3e7dd03af42d337b11552e782e2dc4 Mon Sep 17 00:00:00 2001 From: Anton Golov Date: Sat, 31 Jul 2021 20:35:37 +0200 Subject: Warn when an escaped newline skips multiple lines --- compiler/rustc_parse/src/lexer/unescape_error_reporting.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/rustc_parse') diff --git a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs index 4e95cdc0efa..aa6b424ce2b 100644 --- a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs +++ b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs @@ -280,6 +280,11 @@ pub(crate) fn emit_unescape_error( format!("non-ASCII whitespace symbol '{}' is not skipped", c.escape_unicode()); handler.struct_span_warn(span, &msg).span_label(char_span, &msg).emit(); } + EscapeError::MultipleSkippedLinesWarning => { + let msg = "multiple lines skipped by escaped newline"; + let bottom_msg = "skipping everything up to and including this point"; + handler.struct_span_warn(span, msg).span_label(span, bottom_msg).emit(); + } } } -- cgit 1.4.1-3-g733a5