summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs
blob: 2ed50d709b9268f7d2e74a305f673680acb24ba3 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// check-pass

// compile-flags: --emit=mir,link -O

// There is an ICE somewhere in type normalization, and we are hitting it during
// the MIR inlining pass on this code.
//
// Long term, we should fix that ICE and change the compile-flags for this test
// to explicitly enable MIR inlining.
//
// Short term, we are diabling MIR inlining for Rust 1.64-beta, so that we avoid
// this ICE in this instance.

pub trait Trait {
    type Associated;
}
impl<T> Trait for T {
    type Associated = T;
}

pub struct Struct<T>(<T as Trait>::Associated);

pub fn foo<T>() -> Struct<T>
where
    T: Trait,
{
    bar()
}

#[inline]
fn bar<T>() -> Struct<T> {
    Struct(baz())
}

fn baz<T>() -> T {
    unimplemented!()
}

fn main() { }