]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/closure-bounds-subtype.rs
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
[rust.git] / tests / ui / closures / closure-bounds-subtype.rs
1 fn take_any<F>(_: F) where F: FnOnce() {
2 }
3
4 fn take_const_owned<F>(_: F) where F: FnOnce() + Sync + Send {
5 }
6
7 fn give_any<F>(f: F) where F: FnOnce() {
8     take_any(f);
9 }
10
11 fn give_owned<F>(f: F) where F: FnOnce() + Send {
12     take_any(f);
13     take_const_owned(f); //~ ERROR `F` cannot be shared between threads safely [E0277]
14 }
15
16 fn main() {}