-
Notifications
You must be signed in to change notification settings - Fork 13.3k
-Zinstrument-coverage and matches!() #84892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
/cc @richkadel |
Triage: Can you still reproduce this? If yes, can you add a minimal reproducer please? |
yes, I can still repro this. I don't have a minimized reproducer though; that'll take a half an hour maybe tomorrow... |
Triage: Relabeling issues which don't have a runnable reproduction (as opposed to having a non-minimized one) to the new label S-needs-repro. |
Minimal Reproducer:
fn main() {
assert!(matches!(Some(10), Some(_)));
}
#[cfg(test)]
#[test]
fn run() {
main()
} Test runner bash script: output=cov-testcase.profdata;
function tst ()
{
rm -f cov-testcase-*.profraw
RUST_BACKTRACE=1 LLVM_PROFILE_FILE="cov-testcase-%m.profraw" RUSTFLAGS="-Cinstrument-coverage" cargo test
local covstatus=$?
if [ $covstatus -eq 0 ]; then
cargo profdata -- merge cov-testcase-*.profraw --output="$output"
fi
return $covstatus
}
function objects() {
for file in $( \
LLVM_PROFILE_FILE="cov-testcase-%m.profraw" RUSTFLAGS="-Cinstrument-coverage" cargo test --no-run --message-format=json 2> /dev/null | \
jq -r "select(.profile.test == true) | .filenames[]" | \
grep -v dSYM - \
); do
/bin/echo -n "-object $file ";
done
echo
}
tst
cargo cov -- show \
--instr-profile="$output" \
$(objects) \
--show-line-counts-or-regions \
--name main \
-Xdemangler=rustfilt Output:
|
@rustbot label -S-needs-repro |
When using
-Zinstrument-coverage
on a recent (first-week-of-May-2021) nightly, thematches!
macro is no longer marked covered. (This is likely related to macro coverage rules recently adjusted.) The macro was marked covered earlier in April.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: