mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-29 03:27:44 +00:00
19 lines
353 B
Rust
19 lines
353 B
Rust
//@ 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>();
|
|
}
|