]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
1 // Test that the NLL solver cannot find a solution
2 // for `exists<R1> { forall<R1> { R2: R1 } }`.
4 // In this test, the impl should match `fn(T)` for some `T`,
5 // but we ask it to match `for<'a> fn(&'a ())`. Due to argument
6 // contravariance, this effectively requires a `T = &'b ()` where
7 // `forall<'a> { 'a: 'b }`. Therefore, we get an error.
9 // Note the use of `-Zno-leak-check` here. This is presently required in order
10 // to skip the leak-check errors.
14 // compile-flags:-Zno-leak-check
18 fn make_f() -> Self::F
;
24 fn make_f() -> Self::F
{
30 let _x
= <fn(&())>::make_f();
31 //~^ ERROR implementation of `Y` is not general enough
32 //~| ERROR implementation of `Y` is not general enough