]> git.lizzy.rs Git - rust.git/blob - tests/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / higher-rank-trait-bounds / hrtb-precedence-of-plus-where-clause.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(unused_variables)]
4 // pretty-expanded FIXME #23616
5
6 // Test that `F : Fn(isize) -> isize + Send` is interpreted as two
7 // distinct bounds on `F`.
8
9 fn foo1<F>(f: F)
10     where F : FnOnce(isize) -> isize + Send
11 {
12     bar(f);
13 }
14
15 fn foo2<F>(f: F)
16     where F : FnOnce(isize) -> isize + Send
17 {
18     baz(f);
19 }
20
21 fn bar<F:Send>(f: F) { }
22
23 fn baz<F:FnOnce(isize) -> isize>(f: F) { }
24
25 fn main() {}