]>
Commit | Line | Data |
---|---|---|
1b1a35ee XL |
1 | // Regression test for issue #76202 |
2 | // Tests that we don't ICE when we have a trait impl on a TAIT. | |
3 | ||
487cf647 FG |
4 | // check-pass |
5 | ||
94222f64 | 6 | #![feature(type_alias_impl_trait)] |
1b1a35ee XL |
7 | |
8 | trait Dummy {} | |
9 | impl Dummy for () {} | |
10 | ||
11 | type F = impl Dummy; | |
12 | fn f() -> F {} | |
13 | ||
14 | trait Test { | |
15 | fn test(self); | |
16 | } | |
17 | ||
94222f64 | 18 | impl Test for F { |
487cf647 FG |
19 | fn test(self) {} |
20 | } | |
21 | ||
22 | // Ok because `i32` does not implement `Dummy`, | |
23 | // so it can't possibly be the hidden type of `F`. | |
24 | impl Test for i32 { | |
1b1a35ee XL |
25 | fn test(self) {} |
26 | } | |
27 | ||
28 | fn main() { | |
29 | let x: F = f(); | |
30 | x.test(); | |
31 | } |