]> 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.48.0~beta.8+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 { //~ ERROR cannot implement trait
17 fn test(self) {}
18 }
19
20 fn main() {
21 let x: F = f();
22 x.test();
23 }