summary refs log tree commit diff
path: root/tests/crashes/123893.rs
blob: 05237d002b85a8353f44a0c19b703251604ca71a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ 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;
    }
    more_cost();
    if T::IS_BIG {
        big_impl::<i32>();
    }
}

#[inline(never)]
fn big_impl<T>() {}

#[inline(never)]
fn more_cost() {}