Skip to content

Commit c537f22

Browse files
Give name to full regex capture
1 parent ae22938 commit c537f22

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tools/compiletest/src/errors.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ fn parse_expected(
142142
};
143143

144144
// Get the part of the comment after the sigil (e.g. `~^^` or ~|).
145-
let (_, mut msg) = line.split_at(captures.get(0).unwrap().end());
145+
let whole_match = captures.get(0).unwrap();
146+
let (_, mut msg) = line.split_at(whole_match.end());
146147

147148
let first_word = msg
148149
.split_whitespace()
@@ -176,7 +177,7 @@ fn parse_expected(
176177

177178
debug!(
178179
"line={} tag={:?} which={:?} kind={:?} msg={:?}",
179-
line_num, &captures[0], which, kind, msg
180+
line_num, whole_match.as_str(), which, kind, msg
180181
);
181182
Some((
182183
which,

0 commit comments

Comments
 (0)