Make comptime functions ineligible for coverage - #162354
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
r? @mati865 rustbot has assigned @mati865. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Looks reasonable to me, I'd like to ask for two things to be brought over from my version:
|
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This test demonstrates the existing crash, and will be migrated to a successful coverage test in a subsequent commit. Co-Authored-By: Rachel Barker <rachel.barker@ferrous-systems.com>
Compile-time-only functions don't generate code, so instrumenting them for coverage is useless. This also avoids an ICE when trying to get the function's symbol name for an unused-function record, which can occur when instrumenting `core`. Co-Authored-By: Rachel Barker <rachel.barker@ferrous-systems.com>
Sounds reasonable, done.
Normally I wouldn't add a failing test in its own commit, specifically because I don't want to have a failing intermediate commit. Since you asked, what I've done instead is temporarily add the test as a (If it were a |
Thanks :)
Fair enough, I'm happy with that |
Make comptime functions ineligible for coverage - rust-lang#159777 - rust-lang#161808 --- As reported in rust-lang#161808, the assertion in rust-lang#159777 causes the compiler to ICE when it tries to generate an unused-function record for comptime functions, because comptime functions aren't allowed to have a symbol name. This can occur when trying to instrument `core`, for example. Compile-time-only functions don't generate code, so instrumenting them for coverage is useless anyway. This PR therefore makes them ineligible for coverage, which avoids the problem.
Make comptime functions ineligible for coverage - rust-lang#159777 - rust-lang#161808 --- As reported in rust-lang#161808, the assertion in rust-lang#159777 causes the compiler to ICE when it tries to generate an unused-function record for comptime functions, because comptime functions aren't allowed to have a symbol name. This can occur when trying to instrument `core`, for example. Compile-time-only functions don't generate code, so instrumenting them for coverage is useless anyway. This PR therefore makes them ineligible for coverage, which avoids the problem.
…uwer Rollup of 3 pull requests Successful merges: - #161896 (Remove fields from TypeKind: Array, Slice) - #162354 (Make comptime functions ineligible for coverage) - #162379 (add test ensuring we refuse to const-eval the body of a rustc_do_not_const_check function) Failed merges: - #162294 (Reflection refactor ptrs)
|
@bors try jobs=test-armhf-gnu |
Make comptime functions ineligible for coverage try-job: test-armhf-gnu
This comment has been minimized.
This comment has been minimized.
Make comptime functions ineligible for coverage - rust-lang#159777 - rust-lang#161808 --- As reported in rust-lang#161808, the assertion in rust-lang#159777 causes the compiler to ICE when it tries to generate an unused-function record for comptime functions, because comptime functions aren't allowed to have a symbol name. This can occur when trying to instrument `core`, for example. Compile-time-only functions don't generate code, so instrumenting them for coverage is useless anyway. This PR therefore makes them ineligible for coverage, which avoids the problem.
Make comptime functions ineligible for coverage - rust-lang#159777 - rust-lang#161808 --- As reported in rust-lang#161808, the assertion in rust-lang#159777 causes the compiler to ICE when it tries to generate an unused-function record for comptime functions, because comptime functions aren't allowed to have a symbol name. This can occur when trying to instrument `core`, for example. Compile-time-only functions don't generate code, so instrumenting them for coverage is useless anyway. This PR therefore makes them ineligible for coverage, which avoids the problem.
Make comptime functions ineligible for coverage - rust-lang#159777 - rust-lang#161808 --- As reported in rust-lang#161808, the assertion in rust-lang#159777 causes the compiler to ICE when it tries to generate an unused-function record for comptime functions, because comptime functions aren't allowed to have a symbol name. This can occur when trying to instrument `core`, for example. Compile-time-only functions don't generate code, so instrumenting them for coverage is useless anyway. This PR therefore makes them ineligible for coverage, which avoids the problem.
As reported in #161808, the assertion in #159777 causes the compiler to ICE when it tries to generate an unused-function record for comptime functions, because comptime functions aren't allowed to have a symbol name. This can occur when trying to instrument
core, for example.Compile-time-only functions don't generate code, so instrumenting them for coverage is useless anyway. This PR therefore makes them ineligible for coverage, which avoids the problem.
This PR is essentially a rewrite of #161808. I wanted to request several modifications to that PR, and the overall change is small enough that it was easier for me to just recreate it from scratch.
The main differences are:
cc @fmease @oli-obk as I'm not familiar with comptime