Files
rust/tests/coverage/comptime.rs
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

12 lines
328 B
Rust

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