about summary refs log tree commit diff
path: root/tests/ui/closures/deduce-signature/obligation-with-leaking-placeholders.rs
blob: f8e3b14f9276980dc0e2211b80f9922330186eb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver

// See #124385 for more details.

trait Foo<'a> {}
fn needs_foo<T>(_: T)
where
    for<'a> Wrap<T>: Foo<'a>,
{
}

struct Wrap<T>(T);
impl<'a, T> Foo<'a> for Wrap<T> where T: Fn(&'a i32) {}

fn main() {
    needs_foo(|x| {
        //[current]~^ ERROR implementation of `Foo` is not general enough
        //[next]~^^ ERROR type annotations needed
        x.to_string();
    });
}