]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-44005.rs
Pass cflags rather than cxxflags to LLVM as CMAKE_C_FLAGS
[rust.git] / src / test / ui / issues / issue-44005.rs
1 // compile-pass
2 pub trait Foo<'a> {
3     type Bar;
4     fn foo(&'a self) -> Self::Bar;
5 }
6
7 impl<'a, 'b, T: 'a> Foo<'a> for &'b T {
8     type Bar = &'a T;
9     fn foo(&'a self) -> &'a T {
10         self
11     }
12 }
13
14 pub fn uncallable<T, F>(x: T, f: F)
15     where T: for<'a> Foo<'a>,
16           F: for<'a> Fn(<T as Foo<'a>>::Bar)
17 {
18     f(x.foo());
19 }
20
21 pub fn catalyst(x: &i32) {
22     broken(x, |_| {})
23 }
24
25 pub fn broken<F: Fn(&i32)>(x: &i32, f: F) {
26     uncallable(x, |y| f(y));
27 }
28
29 fn main() { }