]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
1c2051e7eaeebef25bdef7008e334b58493be71a
[rust.git] / src / test / ui / type-alias-impl-trait / issue-57611-trait-alias.rs
1 // Regression test for issue #57611
2 // Ensures that we don't ICE
3 // FIXME: This should compile, but it currently doesn't
4
5 #![feature(trait_alias)]
6 #![feature(type_alias_impl_trait)]
7
8 trait Foo {
9     type Bar: Baz<Self, Self>;
10
11     fn bar(&self) -> Self::Bar;
12 }
13
14 struct X;
15
16 impl Foo for X {
17     type Bar = impl Baz<Self, Self>; //~ ERROR type mismatch in closure arguments
18     //~^ ERROR type mismatch resolving
19
20     fn bar(&self) -> Self::Bar {
21         |x| x
22     }
23 }
24
25 trait Baz<A, B> = Fn(&A) -> &B;
26
27 fn main() {}