]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mir/issue-67639-normalization-ice.rs
Merge commit 'e228f0c16ea8c34794a6285bf57aab627c26b147' into libgccjit-codegen
[rust.git] / src / test / ui / mir / issue-67639-normalization-ice.rs
1 // compile-flags: -Z mir-opt-level=4
2 // build-pass
3
4 // This used to ICE in const-prop due
5 // to an empty ParamEnv being used during normalization
6 // of a generic type
7
8
9 fn main() {
10     join_all::<u32>();
11 }
12
13 trait Foo {
14     type Item;
15 }
16
17 impl Foo for u32 {
18     type Item = u8;
19 }
20
21 trait Bar {
22     type Item2;
23 }
24
25 impl Bar for u8 {
26     type Item2 = u64;
27 }
28
29 fn join_all<I>()
30 where I: Foo,
31     I::Item: Bar
32 {
33     Vec::<<I::Item as Bar>::Item2>::new(); // ICE occurs processing this line
34 }