about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2019-11-21 14:13:42 -0800
committerDylan MacKenzie <ecstaticmorse@gmail.com>2019-11-21 14:13:42 -0800
commitc537f229009bcec23ac89132fd6f571acbc23c38 (patch)
tree4ede2a9e9aff7e70ed2cd87b2924b6f01d248e52
parentae2293837e4c66deaeeb6a895087cb5c76e935ea (diff)
downloadrust-c537f229009bcec23ac89132fd6f571acbc23c38.tar.gz
rust-c537f229009bcec23ac89132fd6f571acbc23c38.zip
Give name to full regex capture
-rw-r--r--src/tools/compiletest/src/errors.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/errors.rs b/src/tools/compiletest/src/errors.rs
index 2524468766f..0ec2738181e 100644
--- a/src/tools/compiletest/src/errors.rs
+++ b/src/tools/compiletest/src/errors.rs
@@ -142,7 +142,8 @@ fn parse_expected(
     };
 
     // Get the part of the comment after the sigil (e.g. `~^^` or ~|).
-    let (_, mut msg) = line.split_at(captures.get(0).unwrap().end());
+    let whole_match = captures.get(0).unwrap();
+    let (_, mut msg) = line.split_at(whole_match.end());
 
     let first_word = msg
         .split_whitespace()
@@ -176,7 +177,7 @@ fn parse_expected(
 
     debug!(
         "line={} tag={:?} which={:?} kind={:?} msg={:?}",
-        line_num, &captures[0], which, kind, msg
+        line_num, whole_match.as_str(), which, kind, msg
     );
     Some((
         which,