rust/tests/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus-where-clause.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
428 B
Rust
Raw Normal View History

// 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`.
2014-11-26 18:21:45 +00:00
fn foo1<F>(f: F)
where F : FnOnce(isize) -> isize + Send
{
bar(f);
2014-11-26 18:21:45 +00:00
}
fn foo2<F>(f: F)
where F : FnOnce(isize) -> isize + Send
2014-11-26 18:21:45 +00:00
{
baz(f);
}
fn bar<F:Send>(f: F) { }
fn baz<F:FnOnce(isize) -> isize>(f: F) { }
fn main() {}