2015-01-03 10:45:00 -05:00
|
|
|
struct X<F> where F: FnOnce() + 'static + Send {
|
|
|
|
|
field: F,
|
2013-06-13 19:38:36 -04:00
|
|
|
}
|
|
|
|
|
|
2015-01-03 10:45:00 -05:00
|
|
|
fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
|
2018-06-09 16:53:36 -07:00
|
|
|
//~^ ERROR `F` cannot be sent between threads safely
|
2015-01-03 10:45:00 -05:00
|
|
|
return X { field: blk };
|
2024-02-09 12:17:55 +00:00
|
|
|
//~^ ERROR `F` cannot be sent between threads safely
|
2013-06-13 19:38:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
}
|