]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / type-alias-impl-trait / issue-76202-trait-impl-for-tait.rs
1 // Regression test for issue #76202
2 // Tests that we don't ICE when we have a trait impl on a TAIT.
3
4 #![feature(type_alias_impl_trait)]
5
6 trait Dummy {}
7 impl Dummy for () {}
8
9 type F = impl Dummy;
10 fn f() -> F {}
11
12 trait Test {
13     fn test(self);
14 }
15
16 impl Test for F { //~ ERROR cannot implement trait
17     fn test(self) {}
18 }
19
20 fn main() {
21     let x: F = f();
22     x.test();
23 }