about summary refs log tree commit diff
path: root/tests/ui/methods/filter-relevant-fn-bounds.rs
blob: 6233c9db53a0bc01ea1de8c0e43be008dfdf9003 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
trait Output<'a> {
    type Type;
}

struct Wrapper;

impl Wrapper {
    fn do_something_wrapper<O, F>(self, _: F)
    //~^ ERROR the trait bound `for<'a> F: Output<'a>` is not satisfied
    where
        F: for<'a> FnOnce(<F as Output<'a>>::Type),
        //~^ ERROR the trait bound `for<'a> F: Output<'a>` is not satisfied
        //~| ERROR the trait bound `for<'a> F: Output<'a>` is not satisfied
    {
    }
}

fn main() {
    let mut wrapper = Wrapper;
    wrapper.do_something_wrapper(|value| ());
    //~^ ERROR expected a `FnOnce
}