From f55736365a886d6fbb90cf97e3941c76d77536f2 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sat, 28 Dec 2024 14:23:12 +1100 Subject: [PATCH] compiletest: Make a FIXME for escaped newlines less confusing The old FIXME implies that we don't support escaped newlines, but in fact it was added in the same patch that added support for escaped newlines. The new FIXME makes it clear that we do currently support this, and that the FIXME is for doing so in a less ad-hoc way. --- src/tools/compiletest/src/header.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 73d00fbf7b85..48149e3b897e 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -1156,7 +1156,9 @@ fn parse_normalize_rule(raw_value: &str) -> Option<(String, String)> { .captures(raw_value)?; let regex = captures["regex"].to_owned(); let replacement = captures["replacement"].to_owned(); - // FIXME: Support escaped new-line in strings. + // A `\n` sequence in the replacement becomes an actual newline. + // FIXME: Do unescaping in a less ad-hoc way, and perhaps support escaped + // backslashes and double-quotes. let replacement = replacement.replace("\\n", "\n"); Some((regex, replacement)) }