]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
Rollup merge of #95579 - Cyborus04:slice_flatten, r=scottmcm
[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 // known-bug
5
6 // revisions: base nll
7 // ignore-compare-mode-nll
8 //[nll] compile-flags: -Z borrowck=mir
9
10 #![feature(trait_alias)]
11 #![feature(type_alias_impl_trait)]
12
13 trait Foo {
14     type Bar: Baz<Self, Self>;
15
16     fn bar(&self) -> Self::Bar;
17 }
18
19 struct X;
20
21 impl Foo for X {
22     type Bar = impl Baz<Self, Self>;
23
24     fn bar(&self) -> Self::Bar {
25         |x| x
26     }
27 }
28
29 trait Baz<A: ?Sized, B: ?Sized> = Fn(&A) -> &B;
30
31 fn main() {}