2024-04-16 18:01:07 -05:00
|
|
|
//@ known-bug: #123893
|
|
|
|
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes -Zinline-mir-threshold=20
|
|
|
|
pub fn main() {
|
|
|
|
generic_impl::<bool>();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn generic_impl<T>() {
|
|
|
|
trait MagicTrait {
|
|
|
|
const IS_BIG: bool;
|
|
|
|
}
|
|
|
|
impl<T> MagicTrait for T {
|
|
|
|
const IS_BIG: bool = true;
|
|
|
|
}
|
2024-06-17 02:36:21 -05:00
|
|
|
more_cost();
|
2024-04-16 18:01:07 -05:00
|
|
|
if T::IS_BIG {
|
|
|
|
big_impl::<i32>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline(never)]
|
|
|
|
fn big_impl<T>() {}
|
2024-06-17 02:36:21 -05:00
|
|
|
|
|
|
|
#[inline(never)]
|
|
|
|
fn more_cost() {}
|