]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-84660-trait-impl-for-tait.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / issue-84660-trait-impl-for-tait.rs
1 // Regression test for issues #84660 and #86411: both are variations on #76202.
2 // Tests that we don't ICE when we have an opaque type appearing anywhere in an impl header.
3
4 #![feature(type_alias_impl_trait)]
5
6 trait Foo {}
7 impl Foo for () {}
8 type Bar = impl Foo;
9 fn _defining_use() -> Bar {}
10
11 trait TraitArg<T> {
12     fn f();
13 }
14
15 impl TraitArg<Bar> for () { //~ ERROR cannot implement trait
16     fn f() {
17         println!("ho");
18     }
19 }
20
21 fn main() {
22     <() as TraitArg<Bar>>::f();
23 }