]> git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.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 {
17 //~^ ERROR cannot implement trait
18 fn test(self) {}
19 }
20
21 fn main() {
22 let x: F = f();
23 x.test();
24 }