summaryrefslogtreecommitdiffstats
path: root/src/test/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs
blob: 42247798f661b1ec7887e15d5023a9b688c95512 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
// pretty-expanded FIXME #23616

// Test that `F : Fn(isize) -> isize + Send` is interpreted as two
// distinct bounds on `F`.

fn foo1<F>(f: F)
    where F : FnOnce(isize) -> isize + Send
{
    bar(f);
}

fn foo2<F>(f: F)
    where F : FnOnce(isize) -> isize + Send
{
    baz(f);
}

fn bar<F:Send>(f: F) { }

fn baz<F:FnOnce(isize) -> isize>(f: F) { }

fn main() {}