Skip to content

Commit 911cbae

Browse files
committed
Add test.
1 parent 10e71df commit 911cbae

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// This test verifies that we do not ICE due to MIR inlining in case of normalization failure
2+
// in a projection.
3+
//
4+
// compile-flags: --crate-type lib -C opt-level=3
5+
// build-pass
6+
7+
pub trait Trait {
8+
type Associated;
9+
}
10+
impl<T> Trait for T {
11+
type Associated = T;
12+
}
13+
14+
pub struct Struct<T>(<T as Trait>::Associated);
15+
16+
pub fn foo<T>() -> Struct<T>
17+
where
18+
T: Trait,
19+
{
20+
bar()
21+
}
22+
23+
#[inline]
24+
fn bar<T>() -> Struct<T> {
25+
Struct(baz())
26+
}
27+
28+
fn baz<T>() -> T {
29+
unimplemented!()
30+
}

0 commit comments

Comments
 (0)