]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/closure-bounds-subtype.stderr
Rollup merge of #106779 - RReverser:patch-2, r=Mark-Simulacrum
[rust.git] / tests / ui / closures / closure-bounds-subtype.stderr
1 error[E0277]: `F` cannot be shared between threads safely
2   --> $DIR/closure-bounds-subtype.rs:13:22
3    |
4 LL |     take_const_owned(f);
5    |     ---------------- ^ `F` cannot be shared between threads safely
6    |     |
7    |     required by a bound introduced by this call
8    |
9 note: required by a bound in `take_const_owned`
10   --> $DIR/closure-bounds-subtype.rs:4:50
11    |
12 LL | fn take_const_owned<F>(_: F) where F: FnOnce() + Sync + Send {
13    |                                                  ^^^^ required by this bound in `take_const_owned`
14 help: use parentheses to call this type parameter
15    |
16 LL |     take_const_owned(f());
17    |                       ++
18 help: consider further restricting this bound
19    |
20 LL | fn give_owned<F>(f: F) where F: FnOnce() + Send + std::marker::Sync {
21    |                                                 +++++++++++++++++++
22
23 error: aborting due to previous error
24
25 For more information about this error, try `rustc --explain E0277`.