Files
rust/tests/coverage/comptime.coverage
Zalathar 0027ee1612 Make comptime functions ineligible for coverage
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>
2026-09-07 19:59:03 +10:00

13 lines
483 B
Plaintext

LL| |#![feature(rustc_attrs)]
LL| |//@ edition: 2024
LL| |
LL| |// Check that instrumenting a crate with a comptime function doesn't ICE.
LL| |// (The function itself doesn't need to be instrumented, and probably shouldn't be.)
LL| |// Regression test for <https://github.com/rust-lang/rust/pull/161808>.
LL| |
LL| |#[rustc_comptime]
LL| |fn comptime_fn() {}
LL| |
LL| 1|fn main() {}