]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-73229.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-73229.rs
1 // check-pass
2
3 fn any<T>() -> T {
4     loop {}
5 }
6
7 trait Foo {
8     type V;
9 }
10
11 trait Callback<T: Foo>: Fn(&T, &T::V) {}
12 impl<T: Foo, F: Fn(&T, &T::V)> Callback<T> for F {}
13
14 struct Bar<T: Foo> {
15     callback: Box<dyn Callback<T>>,
16 }
17
18 impl<T: Foo> Bar<T> {
19     fn event(&self) {
20         (self.callback)(any(), any());
21     }
22 }
23
24 struct A;
25 struct B;
26 impl Foo for A {
27     type V = B;
28 }
29
30 fn main() {
31     let foo = Bar::<A> { callback: Box::new(|_: &A, _: &B| ()) };
32     foo.event();
33 }