rust/tests/coverage/branch/generics.rs
Zalathar 87c2f9a5be Revert "Auto merge of #130766 - clarfonthey:stable-coverage-attribute, r=wesleywiser"
This reverts commit 1d35638dc38dbfbf1cc2a9823135dfcf3c650169, reversing
changes made to f23a80a4c2fbca593b64e70f5970368824b4c5e9.
2024-12-23 12:30:37 +11:00

20 lines
385 B
Rust

#![feature(coverage_attribute)]
//@ edition: 2021
//@ compile-flags: -Zcoverage-options=branch
//@ llvm-cov-flags: --show-branches=count
fn print_size<T>() {
if std::mem::size_of::<T>() > 4 {
println!("size > 4");
} else {
println!("size <= 4");
}
}
#[coverage(off)]
fn main() {
print_size::<()>();
print_size::<u32>();
print_size::<u64>();
}