]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
[rust.git] / tests / ui / type-alias-impl-trait / issue-57611-trait-alias.rs
1 // check-pass
2 // Regression test for issue #57611
3 // Ensures that we don't ICE
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>;
18
19     fn bar(&self) -> Self::Bar {
20         |x| x
21     }
22 }
23
24 trait Baz<A: ?Sized, B: ?Sized> = Fn(&A) -> &B;
25
26 fn main() {}