Skip to content

Commit

Permalink
Give name to full regex capture
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Nov 21, 2019
1 parent ae22938 commit c537f22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tools/compiletest/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c537f22

Please sign in to comment.